1 // SPDX-License-Identifier: GPL-2.0
3 // Copyright (c) 2006-2009 Victor Chukhantsev, Denis Grigoriev,
4 // Copyright (c) 2007-2010 Vasily Khoruzhick
6 // based on smdk2440 written by Ben Dooks
8 #include <linux/kernel.h>
9 #include <linux/types.h>
10 #include <linux/interrupt.h>
11 #include <linux/list.h>
12 #include <linux/memblock.h>
13 #include <linux/delay.h>
14 #include <linux/timer.h>
15 #include <linux/init.h>
16 #include <linux/gpio.h>
17 #include <linux/gpio/machine.h>
18 #include <linux/platform_device.h>
19 #include <linux/serial_core.h>
20 #include <linux/serial_s3c.h>
21 #include <linux/input.h>
22 #include <linux/gpio_keys.h>
23 #include <linux/device.h>
24 #include <linux/pda_power.h>
25 #include <linux/pwm_backlight.h>
26 #include <linux/pwm.h>
27 #include <linux/s3c_adc_battery.h>
28 #include <linux/leds.h>
29 #include <linux/i2c.h>
31 #include <linux/mtd/mtd.h>
32 #include <linux/mtd/partitions.h>
34 #include <linux/mmc/host.h>
36 #include <asm/mach-types.h>
37 #include <asm/mach/arch.h>
38 #include <asm/mach/map.h>
40 #include <linux/platform_data/i2c-s3c2410.h>
41 #include <linux/platform_data/mmc-s3cmci.h>
42 #include <linux/platform_data/mtd-nand-s3c2410.h>
43 #include <linux/platform_data/touchscreen-s3c2410.h>
44 #include <linux/platform_data/usb-s3c2410_udc.h>
45 #include <linux/platform_data/fb-s3c2410.h>
47 #include <sound/uda1380.h>
49 #include "hardware-s3c24xx.h"
50 #include "regs-gpio.h"
51 #include "gpio-samsung.h"
61 #define LCD_PWM_PERIOD 192960
62 #define LCD_PWM_DUTY 127353
64 static struct map_desc rx1950_iodesc
[] __initdata
= {
67 static struct s3c2410_uartcfg rx1950_uartcfgs
[] __initdata
= {
74 .clk_sel
= S3C2410_UCON_CLKSEL3
,
82 .clk_sel
= S3C2410_UCON_CLKSEL3
,
91 .clk_sel
= S3C2410_UCON_CLKSEL3
,
95 static struct s3c2410fb_display rx1950_display
= {
96 .type
= S3C2410_LCDCON1_TFT
,
111 .lcdcon5
= S3C2410_LCDCON5_FRM565
|
112 S3C2410_LCDCON5_INVVCLK
|
113 S3C2410_LCDCON5_INVVLINE
|
114 S3C2410_LCDCON5_INVVFRAME
|
115 S3C2410_LCDCON5_HWSWP
|
121 static int power_supply_init(struct device
*dev
)
123 return gpio_request(S3C2410_GPF(2), "cable plugged");
126 static int rx1950_is_ac_online(void)
128 return !gpio_get_value(S3C2410_GPF(2));
131 static void power_supply_exit(struct device
*dev
)
133 gpio_free(S3C2410_GPF(2));
136 static char *rx1950_supplicants
[] = {
140 static struct pda_power_pdata power_supply_info
= {
141 .init
= power_supply_init
,
142 .is_ac_online
= rx1950_is_ac_online
,
143 .exit
= power_supply_exit
,
144 .supplied_to
= rx1950_supplicants
,
145 .num_supplicants
= ARRAY_SIZE(rx1950_supplicants
),
148 static struct resource power_supply_resources
[] = {
149 [0] = DEFINE_RES_NAMED(IRQ_EINT2
, 1, "ac", IORESOURCE_IRQ \
150 | IORESOURCE_IRQ_LOWEDGE
| IORESOURCE_IRQ_HIGHEDGE
),
153 static struct platform_device power_supply
= {
160 .resource
= power_supply_resources
,
161 .num_resources
= ARRAY_SIZE(power_supply_resources
),
164 static const struct s3c_adc_bat_thresh bat_lut_noac
[] = {
165 { .volt
= 4100, .cur
= 156, .level
= 100},
166 { .volt
= 4050, .cur
= 156, .level
= 95},
167 { .volt
= 4025, .cur
= 141, .level
= 90},
168 { .volt
= 3995, .cur
= 144, .level
= 85},
169 { .volt
= 3957, .cur
= 162, .level
= 80},
170 { .volt
= 3931, .cur
= 147, .level
= 75},
171 { .volt
= 3902, .cur
= 147, .level
= 70},
172 { .volt
= 3863, .cur
= 153, .level
= 65},
173 { .volt
= 3838, .cur
= 150, .level
= 60},
174 { .volt
= 3800, .cur
= 153, .level
= 55},
175 { .volt
= 3765, .cur
= 153, .level
= 50},
176 { .volt
= 3748, .cur
= 172, .level
= 45},
177 { .volt
= 3740, .cur
= 153, .level
= 40},
178 { .volt
= 3714, .cur
= 175, .level
= 35},
179 { .volt
= 3710, .cur
= 156, .level
= 30},
180 { .volt
= 3963, .cur
= 156, .level
= 25},
181 { .volt
= 3672, .cur
= 178, .level
= 20},
182 { .volt
= 3651, .cur
= 178, .level
= 15},
183 { .volt
= 3629, .cur
= 178, .level
= 10},
184 { .volt
= 3612, .cur
= 162, .level
= 5},
185 { .volt
= 3605, .cur
= 162, .level
= 0},
188 static const struct s3c_adc_bat_thresh bat_lut_acin
[] = {
189 { .volt
= 4200, .cur
= 0, .level
= 100},
190 { .volt
= 4190, .cur
= 0, .level
= 99},
191 { .volt
= 4178, .cur
= 0, .level
= 95},
192 { .volt
= 4110, .cur
= 0, .level
= 70},
193 { .volt
= 4076, .cur
= 0, .level
= 65},
194 { .volt
= 4046, .cur
= 0, .level
= 60},
195 { .volt
= 4021, .cur
= 0, .level
= 55},
196 { .volt
= 3999, .cur
= 0, .level
= 50},
197 { .volt
= 3982, .cur
= 0, .level
= 45},
198 { .volt
= 3965, .cur
= 0, .level
= 40},
199 { .volt
= 3957, .cur
= 0, .level
= 35},
200 { .volt
= 3948, .cur
= 0, .level
= 30},
201 { .volt
= 3936, .cur
= 0, .level
= 25},
202 { .volt
= 3927, .cur
= 0, .level
= 20},
203 { .volt
= 3906, .cur
= 0, .level
= 15},
204 { .volt
= 3880, .cur
= 0, .level
= 10},
205 { .volt
= 3829, .cur
= 0, .level
= 5},
206 { .volt
= 3820, .cur
= 0, .level
= 0},
209 static struct gpiod_lookup_table rx1950_bat_gpio_table
= {
210 .dev_id
= "s3c-adc-battery",
212 /* Charge status S3C2410_GPF(3) */
213 GPIO_LOOKUP("GPIOF", 3, "charge-status", GPIO_ACTIVE_HIGH
),
218 static int rx1950_bat_init(void)
222 ret
= gpio_request(S3C2410_GPJ(2), "rx1950-charger-enable-1");
225 ret
= gpio_request(S3C2410_GPJ(3), "rx1950-charger-enable-2");
232 gpio_free(S3C2410_GPJ(2));
237 static void rx1950_bat_exit(void)
239 gpio_free(S3C2410_GPJ(2));
240 gpio_free(S3C2410_GPJ(3));
243 static void rx1950_enable_charger(void)
245 gpio_direction_output(S3C2410_GPJ(2), 1);
246 gpio_direction_output(S3C2410_GPJ(3), 1);
249 static void rx1950_disable_charger(void)
251 gpio_direction_output(S3C2410_GPJ(2), 0);
252 gpio_direction_output(S3C2410_GPJ(3), 0);
255 static DEFINE_SPINLOCK(rx1950_blink_spin
);
257 static int rx1950_led_blink_set(struct gpio_desc
*desc
, int state
,
258 unsigned long *delay_on
, unsigned long *delay_off
)
260 int gpio
= desc_to_gpio(desc
);
261 int blink_gpio
, check_gpio
;
265 blink_gpio
= S3C2410_GPA(4);
266 check_gpio
= S3C2410_GPA(3);
269 blink_gpio
= S3C2410_GPA(3);
270 check_gpio
= S3C2410_GPA(4);
277 if (delay_on
&& delay_off
&& !*delay_on
&& !*delay_off
)
278 *delay_on
= *delay_off
= 500;
280 spin_lock(&rx1950_blink_spin
);
283 case GPIO_LED_NO_BLINK_LOW
:
284 case GPIO_LED_NO_BLINK_HIGH
:
285 if (!gpio_get_value(check_gpio
))
286 gpio_set_value(S3C2410_GPJ(6), 0);
287 gpio_set_value(blink_gpio
, 0);
288 gpio_set_value(gpio
, state
);
291 gpio_set_value(gpio
, 0);
292 gpio_set_value(S3C2410_GPJ(6), 1);
293 gpio_set_value(blink_gpio
, 1);
297 spin_unlock(&rx1950_blink_spin
);
302 static struct gpio_led rx1950_leds_desc
[] = {
305 .default_trigger
= "main-battery-full",
306 .gpio
= S3C2410_GPA(6),
307 .retain_state_suspended
= 1,
312 = "main-battery-charging-blink-full-solid",
313 .gpio
= S3C2410_GPA(7),
314 .retain_state_suspended
= 1,
318 .default_trigger
= "rx1950-acx-mem",
319 .gpio
= S3C2410_GPA(11),
320 .retain_state_suspended
= 1,
324 static struct gpio_led_platform_data rx1950_leds_pdata
= {
325 .num_leds
= ARRAY_SIZE(rx1950_leds_desc
),
326 .leds
= rx1950_leds_desc
,
327 .gpio_blink_set
= rx1950_led_blink_set
,
330 static struct platform_device rx1950_leds
= {
334 .platform_data
= &rx1950_leds_pdata
,
338 static struct s3c_adc_bat_pdata rx1950_bat_cfg
= {
339 .init
= rx1950_bat_init
,
340 .exit
= rx1950_bat_exit
,
341 .enable_charger
= rx1950_enable_charger
,
342 .disable_charger
= rx1950_disable_charger
,
343 .lut_noac
= bat_lut_noac
,
344 .lut_noac_cnt
= ARRAY_SIZE(bat_lut_noac
),
345 .lut_acin
= bat_lut_acin
,
346 .lut_acin_cnt
= ARRAY_SIZE(bat_lut_acin
),
348 .current_channel
= 1,
350 .current_mult
= 2900,
351 .internal_impedance
= 200,
354 static struct platform_device rx1950_battery
= {
355 .name
= "s3c-adc-battery",
358 .parent
= &s3c_device_adc
.dev
,
359 .platform_data
= &rx1950_bat_cfg
,
363 static struct s3c2410fb_mach_info rx1950_lcd_cfg
= {
364 .displays
= &rx1950_display
,
366 .default_display
= 0,
369 .gpccon
= 0xaa9556a9,
370 .gpccon_mask
= 0xffc003fc,
371 .gpccon_reg
= S3C2410_GPCCON
,
373 .gpcup_mask
= 0xffffffff,
374 .gpcup_reg
= S3C2410_GPCUP
,
376 .gpdcon
= 0xaa90aaa1,
377 .gpdcon_mask
= 0xffc0fff0,
378 .gpdcon_reg
= S3C2410_GPDCON
,
380 .gpdup_mask
= 0xffffffff,
381 .gpdup_reg
= S3C2410_GPDUP
,
384 static struct pwm_lookup rx1950_pwm_lookup
[] = {
385 PWM_LOOKUP("samsung-pwm", 0, "pwm-backlight.0", NULL
, 48000,
386 PWM_POLARITY_NORMAL
),
389 static struct pwm_device
*lcd_pwm
;
390 static struct pwm_state lcd_pwm_state
;
392 static void rx1950_lcd_power(int enable
)
396 if (enabled
== enable
)
400 /* GPC11-GPC15->OUTPUT */
401 for (i
= 11; i
< 16; i
++)
402 gpio_direction_output(S3C2410_GPC(i
), 1);
404 /* Wait a bit here... */
407 /* GPD2-GPD7->OUTPUT */
408 /* GPD11-GPD15->OUTPUT */
409 /* GPD2-GPD7->1, GPD11-GPD15->1 */
410 for (i
= 2; i
< 8; i
++)
411 gpio_direction_output(S3C2410_GPD(i
), 1);
412 for (i
= 11; i
< 16; i
++)
413 gpio_direction_output(S3C2410_GPD(i
), 1);
415 /* Wait a bit here...*/
418 /* GPB0->OUTPUT, GPB0->0 */
419 gpio_direction_output(S3C2410_GPB(0), 0);
421 /* GPC1-GPC4->OUTPUT, GPC1-4->0 */
422 for (i
= 1; i
< 5; i
++)
423 gpio_direction_output(S3C2410_GPC(i
), 0);
426 for (i
= 11; i
< 16; i
++)
427 gpio_direction_output(S3C2410_GPC(i
), 0);
429 /* GPD15-GPD11->0, GPD2->GPD7->0 */
430 for (i
= 11; i
< 16; i
++)
431 gpio_direction_output(S3C2410_GPD(i
), 0);
433 for (i
= 2; i
< 8; i
++)
434 gpio_direction_output(S3C2410_GPD(i
), 0);
436 /* GPC6->0, GPC7->0, GPC5->0 */
437 gpio_direction_output(S3C2410_GPC(6), 0);
438 gpio_direction_output(S3C2410_GPC(7), 0);
439 gpio_direction_output(S3C2410_GPC(5), 0);
441 /* GPB1->OUTPUT, GPB1->0 */
442 gpio_direction_output(S3C2410_GPB(1), 0);
444 lcd_pwm_state
.enabled
= false;
445 pwm_apply_state(lcd_pwm
, &lcd_pwm_state
);
447 /* GPC0->0, GPC10->0 */
448 gpio_direction_output(S3C2410_GPC(0), 0);
449 gpio_direction_output(S3C2410_GPC(10), 0);
451 lcd_pwm_state
.enabled
= true;
452 pwm_apply_state(lcd_pwm
, &lcd_pwm_state
);
454 gpio_direction_output(S3C2410_GPC(0), 1);
455 gpio_direction_output(S3C2410_GPC(5), 1);
457 s3c_gpio_cfgpin(S3C2410_GPB(1), S3C2410_GPB1_TOUT1
);
458 gpio_direction_output(S3C2410_GPC(7), 1);
460 for (i
= 1; i
< 5; i
++)
461 s3c_gpio_cfgpin(S3C2410_GPC(i
), S3C_GPIO_SFN(2));
463 for (i
= 11; i
< 16; i
++)
464 s3c_gpio_cfgpin(S3C2410_GPC(i
), S3C_GPIO_SFN(2));
466 for (i
= 2; i
< 8; i
++)
467 s3c_gpio_cfgpin(S3C2410_GPD(i
), S3C_GPIO_SFN(2));
469 for (i
= 11; i
< 16; i
++)
470 s3c_gpio_cfgpin(S3C2410_GPD(i
), S3C_GPIO_SFN(2));
472 gpio_direction_output(S3C2410_GPC(10), 1);
473 gpio_direction_output(S3C2410_GPC(6), 1);
478 static void rx1950_bl_power(int enable
)
481 if (enabled
== enable
)
484 gpio_direction_output(S3C2410_GPB(0), 0);
486 /* LED driver need a "push" to power on */
487 gpio_direction_output(S3C2410_GPB(0), 1);
488 /* Warm up backlight for one period of PWM.
489 * Without this trick its almost impossible to
490 * enable backlight with low brightness value
493 s3c_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0
);
498 static int rx1950_backlight_init(struct device
*dev
)
500 WARN_ON(gpio_request(S3C2410_GPB(0), "Backlight"));
501 lcd_pwm
= pwm_request(1, "RX1950 LCD");
502 if (IS_ERR(lcd_pwm
)) {
503 dev_err(dev
, "Unable to request PWM for LCD power!\n");
504 return PTR_ERR(lcd_pwm
);
508 * This is only required to initialize .polarity; all other values are
509 * fixed in this driver.
511 pwm_init_state(lcd_pwm
, &lcd_pwm_state
);
513 lcd_pwm_state
.period
= LCD_PWM_PERIOD
;
514 lcd_pwm_state
.duty_cycle
= LCD_PWM_DUTY
;
522 static void rx1950_backlight_exit(struct device
*dev
)
528 gpio_free(S3C2410_GPB(0));
532 static int rx1950_backlight_notify(struct device
*dev
, int brightness
)
544 static struct platform_pwm_backlight_data rx1950_backlight_data
= {
545 .max_brightness
= 24,
547 .init
= rx1950_backlight_init
,
548 .notify
= rx1950_backlight_notify
,
549 .exit
= rx1950_backlight_exit
,
552 static struct platform_device rx1950_backlight
= {
553 .name
= "pwm-backlight",
555 .parent
= &samsung_device_pwm
.dev
,
556 .platform_data
= &rx1950_backlight_data
,
560 static void rx1950_set_mmc_power(unsigned char power_mode
, unsigned short vdd
)
562 s3c24xx_mci_def_set_power(power_mode
, vdd
);
564 switch (power_mode
) {
566 gpio_direction_output(S3C2410_GPJ(1), 0);
570 gpio_direction_output(S3C2410_GPJ(1), 1);
577 static struct s3c24xx_mci_pdata rx1950_mmc_cfg __initdata
= {
578 .set_power
= rx1950_set_mmc_power
,
579 .ocr_avail
= MMC_VDD_32_33
,
582 static struct gpiod_lookup_table rx1950_mmc_gpio_table
= {
583 .dev_id
= "s3c2410-sdi",
585 /* Card detect S3C2410_GPF(5) */
586 GPIO_LOOKUP("GPIOF", 5, "cd", GPIO_ACTIVE_LOW
),
587 /* Write protect S3C2410_GPH(8) */
588 GPIO_LOOKUP("GPIOH", 8, "wp", GPIO_ACTIVE_LOW
),
590 GPIO_LOOKUP_IDX("GPIOE", 5, "bus", 0, GPIO_ACTIVE_HIGH
),
591 GPIO_LOOKUP_IDX("GPIOE", 6, "bus", 1, GPIO_ACTIVE_HIGH
),
592 GPIO_LOOKUP_IDX("GPIOE", 7, "bus", 2, GPIO_ACTIVE_HIGH
),
593 GPIO_LOOKUP_IDX("GPIOE", 8, "bus", 3, GPIO_ACTIVE_HIGH
),
594 GPIO_LOOKUP_IDX("GPIOE", 9, "bus", 4, GPIO_ACTIVE_HIGH
),
595 GPIO_LOOKUP_IDX("GPIOE", 10, "bus", 5, GPIO_ACTIVE_HIGH
),
600 static struct mtd_partition rx1950_nand_part
[] = {
605 .mask_flags
= MTD_WRITEABLE
,
609 .offset
= MTDPART_OFS_APPEND
,
611 .mask_flags
= MTD_WRITEABLE
,
615 .offset
= MTDPART_OFS_APPEND
,
620 .name
= "Filesystem",
621 .offset
= MTDPART_OFS_APPEND
,
622 .size
= MTDPART_SIZ_FULL
,
627 static struct s3c2410_nand_set rx1950_nand_sets
[] = {
631 .nr_partitions
= ARRAY_SIZE(rx1950_nand_part
),
632 .partitions
= rx1950_nand_part
,
636 static struct s3c2410_platform_nand rx1950_nand_info
= {
640 .nr_sets
= ARRAY_SIZE(rx1950_nand_sets
),
641 .sets
= rx1950_nand_sets
,
642 .engine_type
= NAND_ECC_ENGINE_TYPE_SOFT
,
645 static struct s3c2410_udc_mach_info rx1950_udc_cfg __initdata
= {
646 .vbus_pin
= S3C2410_GPG(5),
647 .vbus_pin_inverted
= 1,
648 .pullup_pin
= S3C2410_GPJ(5),
651 static struct s3c2410_ts_mach_info rx1950_ts_cfg __initdata
= {
654 .oversampling_shift
= 3,
657 static struct gpio_keys_button rx1950_gpio_keys_table
[] = {
660 .gpio
= S3C2410_GPF(0),
662 .desc
= "Power button",
667 .gpio
= S3C2410_GPF(7),
669 .desc
= "Record button",
673 .gpio
= S3C2410_GPG(0),
675 .desc
= "Calendar button",
679 .gpio
= S3C2410_GPG(2),
681 .desc
= "Contacts button",
685 .gpio
= S3C2410_GPG(3),
687 .desc
= "Mail button",
691 .gpio
= S3C2410_GPG(7),
693 .desc
= "WLAN button",
697 .gpio
= S3C2410_GPG(10),
699 .desc
= "Left button",
703 .gpio
= S3C2410_GPG(11),
705 .desc
= "Right button",
709 .gpio
= S3C2410_GPG(4),
715 .gpio
= S3C2410_GPG(6),
717 .desc
= "Down button",
721 .gpio
= S3C2410_GPG(9),
727 static struct gpio_keys_platform_data rx1950_gpio_keys_data
= {
728 .buttons
= rx1950_gpio_keys_table
,
729 .nbuttons
= ARRAY_SIZE(rx1950_gpio_keys_table
),
732 static struct platform_device rx1950_device_gpiokeys
= {
734 .dev
.platform_data
= &rx1950_gpio_keys_data
,
737 static struct uda1380_platform_data uda1380_info
= {
738 .gpio_power
= S3C2410_GPJ(0),
739 .gpio_reset
= S3C2410_GPD(0),
740 .dac_clk
= UDA1380_DAC_CLK_SYSCLK
,
743 static struct i2c_board_info rx1950_i2c_devices
[] = {
745 I2C_BOARD_INFO("uda1380", 0x1a),
746 .platform_data
= &uda1380_info
,
750 static struct gpiod_lookup_table rx1950_audio_gpio_table
= {
751 .dev_id
= "rx1950-audio",
753 GPIO_LOOKUP("GPIOG", 12, "hp-gpio", GPIO_ACTIVE_HIGH
),
754 GPIO_LOOKUP("GPIOA", 1, "speaker-power", GPIO_ACTIVE_HIGH
),
759 static struct platform_device rx1950_audio
= {
760 .name
= "rx1950-audio",
764 static struct platform_device
*rx1950_devices
[] __initdata
= {
765 &s3c2410_device_dclk
,
770 &s3c_device_usbgadget
,
778 &rx1950_device_gpiokeys
,
785 static void __init
rx1950_map_io(void)
787 s3c24xx_init_io(rx1950_iodesc
, ARRAY_SIZE(rx1950_iodesc
));
788 s3c24xx_init_uarts(rx1950_uartcfgs
, ARRAY_SIZE(rx1950_uartcfgs
));
789 s3c24xx_set_timer_source(S3C24XX_PWM3
, S3C24XX_PWM4
);
793 #ifdef CONFIG_PM_H1940
794 memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT
), h1940_pm_return
, 8);
800 static void __init
rx1950_init_time(void)
802 s3c2442_init_clocks(16934000);
803 s3c24xx_timer_init();
806 static void __init
rx1950_init_machine(void)
810 s3c24xx_fb_set_platdata(&rx1950_lcd_cfg
);
811 s3c24xx_udc_set_platdata(&rx1950_udc_cfg
);
812 s3c24xx_ts_set_platdata(&rx1950_ts_cfg
);
813 gpiod_add_lookup_table(&rx1950_mmc_gpio_table
);
814 s3c24xx_mci_set_platdata(&rx1950_mmc_cfg
);
815 s3c_i2c0_set_platdata(NULL
);
816 s3c_nand_set_platdata(&rx1950_nand_info
);
818 /* Turn off suspend on both USB ports, and switch the
819 * selectable USB port to USB device mode. */
820 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST
|
821 S3C2410_MISCCR_USBSUSPND0
|
822 S3C2410_MISCCR_USBSUSPND1
, 0x0);
824 /* mmc power is disabled by default */
825 WARN_ON(gpio_request(S3C2410_GPJ(1), "MMC power"));
826 gpio_direction_output(S3C2410_GPJ(1), 0);
828 for (i
= 0; i
< 8; i
++)
829 WARN_ON(gpio_request(S3C2410_GPC(i
), "LCD power"));
831 for (i
= 10; i
< 16; i
++)
832 WARN_ON(gpio_request(S3C2410_GPC(i
), "LCD power"));
834 for (i
= 2; i
< 8; i
++)
835 WARN_ON(gpio_request(S3C2410_GPD(i
), "LCD power"));
837 for (i
= 11; i
< 16; i
++)
838 WARN_ON(gpio_request(S3C2410_GPD(i
), "LCD power"));
840 WARN_ON(gpio_request(S3C2410_GPB(1), "LCD power"));
842 WARN_ON(gpio_request(S3C2410_GPA(3), "Red blink"));
843 WARN_ON(gpio_request(S3C2410_GPA(4), "Green blink"));
844 WARN_ON(gpio_request(S3C2410_GPJ(6), "LED blink"));
845 gpio_direction_output(S3C2410_GPA(3), 0);
846 gpio_direction_output(S3C2410_GPA(4), 0);
847 gpio_direction_output(S3C2410_GPJ(6), 0);
849 pwm_add_table(rx1950_pwm_lookup
, ARRAY_SIZE(rx1950_pwm_lookup
));
850 gpiod_add_lookup_table(&rx1950_audio_gpio_table
);
851 gpiod_add_lookup_table(&rx1950_bat_gpio_table
);
852 /* Configure the I2S pins (GPE0...GPE4) in correct mode */
853 s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
855 platform_add_devices(rx1950_devices
, ARRAY_SIZE(rx1950_devices
));
857 i2c_register_board_info(0, rx1950_i2c_devices
,
858 ARRAY_SIZE(rx1950_i2c_devices
));
861 /* H1940 and RX3715 need to reserve this for suspend */
862 static void __init
rx1950_reserve(void)
864 memblock_reserve(0x30003000, 0x1000);
865 memblock_reserve(0x30081000, 0x1000);
868 MACHINE_START(RX1950
, "HP iPAQ RX1950")
869 /* Maintainers: Vasily Khoruzhick */
870 .atag_offset
= 0x100,
871 .map_io
= rx1950_map_io
,
872 .reserve
= rx1950_reserve
,
873 .init_irq
= s3c2442_init_irq
,
874 .init_machine
= rx1950_init_machine
,
875 .init_time
= rx1950_init_time
,