OMAP2: Devkit8000: Setup LCD reset
authorKan-Ru Chen <kanru@0xlab.org>
Mon, 5 Jul 2010 14:04:40 +0000 (17:04 +0300)
committerTony Lindgren <tony@atomide.com>
Mon, 5 Jul 2010 14:04:40 +0000 (17:04 +0300)
This patch corrects the LCD reset pin configuration.

Original code from early devkit8000 patch sets the TWL4030 GPIO_1
to EHCI_nOC and TWL4030_GPIO_MAX+1 to ledA. Indeed these two pins
are both LCD_PWREN. Setup the lcd reset_gpio properly so it can be
disabled when other display is turned on.

Signed-off-by: Kan-Ru Chen <kanru@0xlab.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-devkit8000.c

index 03cb97e..a86d001 100644 (file)
@@ -134,11 +134,15 @@ static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
        twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1);
        twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0);
 
+       if (dssdev->reset_gpio != -EINVAL)
+               gpio_set_value(dssdev->reset_gpio, 1);
        return 0;
 }
 
 static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
 {
+       if (dssdev->reset_gpio != -EINVAL)
+               gpio_set_value(dssdev->reset_gpio, 0);
 }
 
 static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
@@ -183,6 +187,7 @@ static struct omap_dss_device devkit8000_lcd_device = {
        .driver_name            = "generic_panel",
        .type                   = OMAP_DISPLAY_TYPE_DPI,
        .phy.dpi.data_lines     = 24,
+       .reset_gpio             = -EINVAL, /* will be replaced */
        .platform_enable        = devkit8000_panel_enable_lcd,
        .platform_disable       = devkit8000_panel_disable_lcd,
 };
@@ -281,6 +286,12 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
        /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
        gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
 
+        /* gpio + 1 is "LCD_PWREN" (out, active high) */
+       devkit8000_lcd_device.reset_gpio = gpio + 1;
+       gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
+       /* Disable until needed */
+       gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0);
+
        /* gpio + 7 is "DVI_PD" (out, active low) */
        devkit8000_dvi_device.reset_gpio = gpio + 7;
        gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");