Commit 28d7a94680b16673af27779b289b4be2abd2e248
Committed by
Eric Miao
1 parent
7dafdf3d22
[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>
Showing 1 changed file with 27 additions and 9 deletions Side-by-side Diff
arch/arm/mach-pxa/treo680.c
... | ... | @@ -254,16 +254,9 @@ |
254 | 254 | ret = gpio_direction_output(GPIO_NR_TREO680_BL_POWER, 0); |
255 | 255 | if (ret) |
256 | 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 | 258 | return 0; |
265 | -err3: | |
266 | - gpio_free(GPIO_NR_TREO680_LCD_POWER); | |
259 | + | |
267 | 260 | err2: |
268 | 261 | gpio_free(GPIO_NR_TREO680_BL_POWER); |
269 | 262 | err: |
... | ... | @@ -279,7 +272,6 @@ |
279 | 272 | static void treo680_backlight_exit(struct device *dev) |
280 | 273 | { |
281 | 274 | gpio_free(GPIO_NR_TREO680_BL_POWER); |
282 | - gpio_free(GPIO_NR_TREO680_LCD_POWER); | |
283 | 275 | } |
284 | 276 | |
285 | 277 | static struct platform_pwm_backlight_data treo680_backlight_data = { |
... | ... | @@ -470,6 +462,11 @@ |
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 | 470 | static struct pxafb_mach_info treo680_lcd_screen = { |
474 | 471 | .modes = treo680_lcd_modes, |
475 | 472 | .num_modes = ARRAY_SIZE(treo680_lcd_modes), |
476 | 473 | |
... | ... | @@ -509,11 +506,32 @@ |
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 | 529 | static void __init treo680_init(void) |
513 | 530 | { |
514 | 531 | treo680_pm_init(); |
515 | 532 | pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); |
516 | 533 | pxa_set_keypad_info(&treo680_keypad_platform_data); |
534 | + treo680_lcd_power_init(); | |
517 | 535 | set_pxa_fb_info(&treo680_lcd_screen); |
518 | 536 | pxa_set_mci_info(&treo680_mci_platform_data); |
519 | 537 | treo680_udc_init(); |