aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/palmtreo.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/palmtreo.c')
-rw-r--r--arch/arm/mach-pxa/palmtreo.c70
1 files changed, 60 insertions, 10 deletions
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c
index 3f3c48f2f7ce..577512845a6c 100644
--- a/arch/arm/mach-pxa/palmtreo.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -98,9 +98,6 @@ static unsigned long treo_pin_config[] __initdata = {
98 GPIO96_KP_MKOUT_6, 98 GPIO96_KP_MKOUT_6,
99 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, /* Hotsync button */ 99 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, /* Hotsync button */
100 100
101 /* LCD */
102 GPIOxx_LCD_TFT_16BPP,
103
104 /* Quick Capture Interface */ 101 /* Quick Capture Interface */
105 GPIO84_CIF_FV, 102 GPIO84_CIF_FV,
106 GPIO85_CIF_LV, 103 GPIO85_CIF_LV,
@@ -140,6 +137,12 @@ static unsigned long treo680_pin_config[] __initdata = {
140 /* MATRIX KEYPAD - different wake up source */ 137 /* MATRIX KEYPAD - different wake up source */
141 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, 138 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
142 GPIO99_KP_MKIN_5, 139 GPIO99_KP_MKIN_5,
140
141 /* LCD... L_BIAS alt fn not configured on Treo680; is GPIO instead */
142 GPIOxx_LCD_16BPP,
143 GPIO74_LCD_FCLK,
144 GPIO75_LCD_LCLK,
145 GPIO76_LCD_PCLK,
143}; 146};
144#endif /* CONFIG_MACH_TREO680 */ 147#endif /* CONFIG_MACH_TREO680 */
145 148
@@ -155,6 +158,9 @@ static unsigned long centro685_pin_config[] __initdata = {
155 /* MATRIX KEYPAD - different wake up source */ 158 /* MATRIX KEYPAD - different wake up source */
156 GPIO100_KP_MKIN_0, 159 GPIO100_KP_MKIN_0,
157 GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH, 160 GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH,
161
162 /* LCD */
163 GPIOxx_LCD_TFT_16BPP,
158}; 164};
159#endif /* CONFIG_MACH_CENTRO */ 165#endif /* CONFIG_MACH_CENTRO */
160 166
@@ -328,7 +334,6 @@ static inline void palmtreo_uhc_init(void) {}
328/****************************************************************************** 334/******************************************************************************
329 * Vibra and LEDs 335 * Vibra and LEDs
330 ******************************************************************************/ 336 ******************************************************************************/
331#ifdef CONFIG_MACH_TREO680
332static struct gpio_led treo680_gpio_leds[] = { 337static struct gpio_led treo680_gpio_leds[] = {
333 { 338 {
334 .name = "treo680:vibra:vibra", 339 .name = "treo680:vibra:vibra",
@@ -379,21 +384,17 @@ static struct gpio_led_platform_data centro_gpio_led_info = {
379static struct platform_device palmtreo_leds = { 384static struct platform_device palmtreo_leds = {
380 .name = "leds-gpio", 385 .name = "leds-gpio",
381 .id = -1, 386 .id = -1,
382 .dev = {
383 .platform_data = &treo680_gpio_led_info,
384 }
385}; 387};
386 388
387static void __init palmtreo_leds_init(void) 389static void __init palmtreo_leds_init(void)
388{ 390{
389 if (machine_is_centro()) 391 if (machine_is_centro())
390 palmtreo_leds.dev.platform_data = &centro_gpio_led_info; 392 palmtreo_leds.dev.platform_data = &centro_gpio_led_info;
393 else if (machine_is_treo680())
394 palmtreo_leds.dev.platform_data = &treo680_gpio_led_info;
391 395
392 platform_device_register(&palmtreo_leds); 396 platform_device_register(&palmtreo_leds);
393} 397}
394#else
395static inline void palmtreo_leds_init(void) {}
396#endif
397 398
398/****************************************************************************** 399/******************************************************************************
399 * Machine init 400 * Machine init
@@ -424,10 +425,59 @@ static void __init palmphone_common_init(void)
424} 425}
425 426
426#ifdef CONFIG_MACH_TREO680 427#ifdef CONFIG_MACH_TREO680
428void __init treo680_gpio_init(void)
429{
430 unsigned int gpio;
431
432 /* drive all three lcd gpios high initially */
433 const unsigned long lcd_flags = GPIOF_INIT_HIGH | GPIOF_DIR_OUT;
434
435 /*
436 * LCD GPIO initialization...
437 */
438
439 /*
440 * This is likely the power to the lcd. Toggling it low/high appears to
441 * turn the lcd off/on. Can be toggled after lcd is initialized without
442 * any apparent adverse effects to the lcd operation. Note that this
443 * gpio line is used by the lcd controller as the L_BIAS signal, but
444 * treo680 configures it as gpio.
445 */
446 gpio = GPIO_NR_TREO680_LCD_POWER;
447 if (gpio_request_one(gpio, lcd_flags, "LCD power") < 0)
448 goto fail;
449
450 /*
451 * These two are called "enables", for lack of a better understanding.
452 * If either of these are toggled after the lcd is initialized, the
453 * image becomes degraded. N.B. The IPL shipped with the treo
454 * configures GPIO_NR_TREO680_LCD_EN_N as output and drives it high. If
455 * the IPL is ever reprogrammed, this initialization may be need to be
456 * revisited.
457 */
458 gpio = GPIO_NR_TREO680_LCD_EN;
459 if (gpio_request_one(gpio, lcd_flags, "LCD enable") < 0)
460 goto fail;
461 gpio = GPIO_NR_TREO680_LCD_EN_N;
462 if (gpio_request_one(gpio, lcd_flags, "LCD enable_n") < 0)
463 goto fail;
464
465 /* driving this low turns LCD on */
466 gpio_set_value(GPIO_NR_TREO680_LCD_EN_N, 0);
467
468 return;
469 fail:
470 pr_err("gpio %d initialization failed\n", gpio);
471 gpio_free(GPIO_NR_TREO680_LCD_POWER);
472 gpio_free(GPIO_NR_TREO680_LCD_EN);
473 gpio_free(GPIO_NR_TREO680_LCD_EN_N);
474}
475
427static void __init treo680_init(void) 476static void __init treo680_init(void)
428{ 477{
429 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); 478 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config));
430 palmphone_common_init(); 479 palmphone_common_init();
480 treo680_gpio_init();
431 palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, GPIO_NR_TREO680_SD_READONLY, 481 palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, GPIO_NR_TREO680_SD_READONLY,
432 GPIO_NR_TREO680_SD_POWER, 0); 482 GPIO_NR_TREO680_SD_POWER, 0);
433} 483}