da850/omap-l138: add callback to control LCD panel power
authorChaithrika U S <chaithrika@ti.com>
Wed, 16 Dec 2009 00:46:46 +0000 (16:46 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 16 Dec 2009 15:20:05 +0000 (07:20 -0800)
Add the platform specific callback to control LCD panel and backlight
power.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arm/mach-davinci/board-da850-evm.c

index 62b98bffc158c452e5a063e014f78e5b7c497cf7..07de8db145812c68a6cf386ef68ff10c2251f9b7 100644 (file)
@@ -339,6 +339,15 @@ static struct davinci_mmc_config da850_mmc_config = {
        .version        = MMC_CTLR_VERSION_2,
 };
 
+static void da850_panel_power_ctrl(int val)
+{
+       /* lcd backlight */
+       gpio_set_value(DA850_LCD_BL_PIN, val);
+
+       /* lcd power */
+       gpio_set_value(DA850_LCD_PWR_PIN, val);
+}
+
 static int da850_lcd_hw_init(void)
 {
        int status;
@@ -356,17 +365,11 @@ static int da850_lcd_hw_init(void)
        gpio_direction_output(DA850_LCD_BL_PIN, 0);
        gpio_direction_output(DA850_LCD_PWR_PIN, 0);
 
-       /* disable lcd backlight */
-       gpio_set_value(DA850_LCD_BL_PIN, 0);
-
-       /* disable lcd power */
-       gpio_set_value(DA850_LCD_PWR_PIN, 0);
-
-       /* enable lcd power */
-       gpio_set_value(DA850_LCD_PWR_PIN, 1);
+       /* Switch off panel power and backlight */
+       da850_panel_power_ctrl(0);
 
-       /* enable lcd backlight */
-       gpio_set_value(DA850_LCD_BL_PIN, 1);
+       /* Switch on panel power and backlight */
+       da850_panel_power_ctrl(1);
 
        return 0;
 }
@@ -674,6 +677,7 @@ static __init void da850_evm_init(void)
                pr_warning("da850_evm_init: lcd initialization failed: %d\n",
                                ret);
 
+       sharp_lk043t1dg01_pdata.panel_power_ctrl = da850_panel_power_ctrl,
        ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata);
        if (ret)
                pr_warning("da850_evm_init: lcdc registration failed: %d\n",