diff options
author | Tomáš Čech <sleep_walker@suse.cz> | 2009-09-03 10:55:47 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-09-10 06:49:38 -0400 |
commit | 28d7a94680b16673af27779b289b4be2abd2e248 (patch) | |
tree | daa02670ce738c6748040820ed46803a027a78ac | |
parent | 7dafdf3d22a59499a1d4dddeb626c0bc76ef455d (diff) |
[ARM] pxa/treo680: move LCD power GPIO to proper place
Signed-off-by: Tomáš Čech <sleep_walker@suse.cz>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
-rw-r--r-- | arch/arm/mach-pxa/treo680.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/arch/arm/mach-pxa/treo680.c b/arch/arm/mach-pxa/treo680.c index 5d3ec0807708..9a2df64c6599 100644 --- a/arch/arm/mach-pxa/treo680.c +++ b/arch/arm/mach-pxa/treo680.c | |||
@@ -254,16 +254,9 @@ static int treo680_backlight_init(struct device *dev) | |||
254 | ret = gpio_direction_output(GPIO_NR_TREO680_BL_POWER, 0); | 254 | ret = gpio_direction_output(GPIO_NR_TREO680_BL_POWER, 0); |
255 | if (ret) | 255 | if (ret) |
256 | goto err2; | 256 | goto err2; |
257 | ret = gpio_request(GPIO_NR_TREO680_LCD_POWER, "LCD POWER"); | ||
258 | if (ret) | ||
259 | goto err2; | ||
260 | ret = gpio_direction_output(GPIO_NR_TREO680_LCD_POWER, 0); | ||
261 | if (ret) | ||
262 | goto err3; | ||
263 | 257 | ||
264 | return 0; | 258 | return 0; |
265 | err3: | 259 | |
266 | gpio_free(GPIO_NR_TREO680_LCD_POWER); | ||
267 | err2: | 260 | err2: |
268 | gpio_free(GPIO_NR_TREO680_BL_POWER); | 261 | gpio_free(GPIO_NR_TREO680_BL_POWER); |
269 | err: | 262 | err: |
@@ -279,7 +272,6 @@ static int treo680_backlight_notify(int brightness) | |||
279 | static void treo680_backlight_exit(struct device *dev) | 272 | static void treo680_backlight_exit(struct device *dev) |
280 | { | 273 | { |
281 | gpio_free(GPIO_NR_TREO680_BL_POWER); | 274 | gpio_free(GPIO_NR_TREO680_BL_POWER); |
282 | gpio_free(GPIO_NR_TREO680_LCD_POWER); | ||
283 | } | 275 | } |
284 | 276 | ||
285 | static struct platform_pwm_backlight_data treo680_backlight_data = { | 277 | static struct platform_pwm_backlight_data treo680_backlight_data = { |
@@ -470,6 +462,11 @@ static struct pxafb_mode_info treo680_lcd_modes[] = { | |||
470 | }, | 462 | }, |
471 | }; | 463 | }; |
472 | 464 | ||
465 | static void treo680_lcd_power(int on, struct fb_var_screeninfo *info) | ||
466 | { | ||
467 | gpio_set_value(GPIO_NR_TREO680_BL_POWER, on); | ||
468 | } | ||
469 | |||
473 | static struct pxafb_mach_info treo680_lcd_screen = { | 470 | static struct pxafb_mach_info treo680_lcd_screen = { |
474 | .modes = treo680_lcd_modes, | 471 | .modes = treo680_lcd_modes, |
475 | .num_modes = ARRAY_SIZE(treo680_lcd_modes), | 472 | .num_modes = ARRAY_SIZE(treo680_lcd_modes), |
@@ -509,11 +506,32 @@ static void __init treo680_udc_init(void) | |||
509 | } | 506 | } |
510 | } | 507 | } |
511 | 508 | ||
509 | static void __init treo680_lcd_power_init(void) | ||
510 | { | ||
511 | int ret; | ||
512 | |||
513 | ret = gpio_request(GPIO_NR_TREO680_LCD_POWER, "LCD POWER"); | ||
514 | if (ret) { | ||
515 | pr_err("Treo680: LCD power GPIO request failed!\n"); | ||
516 | return; | ||
517 | } | ||
518 | |||
519 | ret = gpio_direction_output(GPIO_NR_TREO680_LCD_POWER, 0); | ||
520 | if (ret) { | ||
521 | pr_err("Treo680: setting LCD power GPIO direction failed!\n"); | ||
522 | gpio_free(GPIO_NR_TREO680_LCD_POWER); | ||
523 | return; | ||
524 | } | ||
525 | |||
526 | treo680_lcd_screen.pxafb_lcd_power = treo680_lcd_power; | ||
527 | } | ||
528 | |||
512 | static void __init treo680_init(void) | 529 | static void __init treo680_init(void) |
513 | { | 530 | { |
514 | treo680_pm_init(); | 531 | treo680_pm_init(); |
515 | pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); | 532 | pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); |
516 | pxa_set_keypad_info(&treo680_keypad_platform_data); | 533 | pxa_set_keypad_info(&treo680_keypad_platform_data); |
534 | treo680_lcd_power_init(); | ||
517 | set_pxa_fb_info(&treo680_lcd_screen); | 535 | set_pxa_fb_info(&treo680_lcd_screen); |
518 | pxa_set_mci_info(&treo680_mci_platform_data); | 536 | pxa_set_mci_info(&treo680_mci_platform_data); |
519 | treo680_udc_init(); | 537 | treo680_udc_init(); |