OMAP3EVM: Made backlight GPIO default state to off
authorVaibhav Hiremath <hvaibhav@ti.com>
Tue, 25 Jan 2011 17:37:40 +0000 (17:37 +0000)
committerTony Lindgren <tony@atomide.com>
Thu, 17 Feb 2011 22:18:02 +0000 (14:18 -0800)
If you choose default output to DVI, the LCD backlight used to
stay on, since panel->disable function never gets called.

So, during init put backlight GPIO to off state and the driver
code will decide which output to enable.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-omap3evm.c

index 36dac55b235c49a734b3f2a849772aecf3fbf868..4f2574c35ddf9d6c421ecb97bf87033b0f73b393 100644 (file)
@@ -456,6 +456,8 @@ static struct platform_device leds_gpio = {
 static int omap3evm_twl_gpio_setup(struct device *dev,
                unsigned gpio, unsigned ngpio)
 {
+       int r;
+
        /* gpio + 0 is "mmc0_cd" (input/IRQ) */
        omap_mux_init_gpio(63, OMAP_PIN_INPUT);
        mmc[0].gpio_cd = gpio + 0;
@@ -471,8 +473,12 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
         */
 
        /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */
-       gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL");
-       gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
+       r = gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL");
+       if (!r)
+               r = gpio_direction_output(gpio + TWL4030_GPIO_MAX,
+                       (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) ? 1 : 0);
+       if (r)
+               printk(KERN_ERR "failed to get/set lcd_bkl gpio\n");
 
        /* gpio + 7 == DVI Enable */
        gpio_request(gpio + 7, "EN_DVI");