diff options
author | Tomáš Čech <sleep_walker@suse.cz> | 2009-09-03 16:55:47 +0200 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-09-10 18:49:38 +0800 |
commit | 28d7a94680b16673af27779b289b4be2abd2e248 (patch) | |
tree | daa02670ce738c6748040820ed46803a027a78ac /arch/arm | |
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>
Diffstat (limited to 'arch/arm')
-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 5d3ec080770..9a2df64c659 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) ret = gpio_direction_output(GPIO_NR_TREO680_BL_POWER, 0); if (ret) goto err2; - ret = gpio_request(GPIO_NR_TREO680_LCD_POWER, "LCD POWER"); - if (ret) - goto err2; - ret = gpio_direction_output(GPIO_NR_TREO680_LCD_POWER, 0); - if (ret) - goto err3; return 0; -err3: - gpio_free(GPIO_NR_TREO680_LCD_POWER); + err2: gpio_free(GPIO_NR_TREO680_BL_POWER); err: @@ -279,7 +272,6 @@ static int treo680_backlight_notify(int brightness) static void treo680_backlight_exit(struct device *dev) { gpio_free(GPIO_NR_TREO680_BL_POWER); - gpio_free(GPIO_NR_TREO680_LCD_POWER); } static struct platform_pwm_backlight_data treo680_backlight_data = { @@ -470,6 +462,11 @@ static struct pxafb_mode_info treo680_lcd_modes[] = { }, }; +static void treo680_lcd_power(int on, struct fb_var_screeninfo *info) +{ + gpio_set_value(GPIO_NR_TREO680_BL_POWER, on); +} + static struct pxafb_mach_info treo680_lcd_screen = { .modes = treo680_lcd_modes, .num_modes = ARRAY_SIZE(treo680_lcd_modes), @@ -509,11 +506,32 @@ static void __init treo680_udc_init(void) } } +static void __init treo680_lcd_power_init(void) +{ + int ret; + + ret = gpio_request(GPIO_NR_TREO680_LCD_POWER, "LCD POWER"); + if (ret) { + pr_err("Treo680: LCD power GPIO request failed!\n"); + return; + } + + ret = gpio_direction_output(GPIO_NR_TREO680_LCD_POWER, 0); + if (ret) { + pr_err("Treo680: setting LCD power GPIO direction failed!\n"); + gpio_free(GPIO_NR_TREO680_LCD_POWER); + return; + } + + treo680_lcd_screen.pxafb_lcd_power = treo680_lcd_power; +} + static void __init treo680_init(void) { treo680_pm_init(); pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); pxa_set_keypad_info(&treo680_keypad_platform_data); + treo680_lcd_power_init(); set_pxa_fb_info(&treo680_lcd_screen); pxa_set_mci_info(&treo680_mci_platform_data); treo680_udc_init(); |