OMAP2: Devkit8000: Remove en-/disable for tv panel
[pandora-kernel.git] / arch / arm / mach-omap2 / board-devkit8000.c
index a0860a9..13ce242 100644 (file)
@@ -134,40 +134,34 @@ 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)
 {
+       if (dssdev->reset_gpio != -EINVAL)
+               gpio_set_value(dssdev->reset_gpio, 1);
        return 0;
 }
 
 static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
 {
+       if (dssdev->reset_gpio != -EINVAL)
+               gpio_set_value(dssdev->reset_gpio, 0);
 }
 
-static int devkit8000_panel_enable_tv(struct omap_dss_device *dssdev)
-{
-
-       return 0;
-}
-
-static void devkit8000_panel_disable_tv(struct omap_dss_device *dssdev)
-{
-}
-
-
 static struct regulator_consumer_supply devkit8000_vmmc1_supply = {
        .supply                 = "vmmc",
 };
 
-static struct regulator_consumer_supply devkit8000_vsim_supply = {
-       .supply                 = "vmmc_aux",
-};
-
 /* ads7846 on SPI */
 static struct regulator_consumer_supply devkit8000_vio_supplies[] = {
        REGULATOR_SUPPLY("vcc", "spi2.0")
@@ -178,6 +172,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,
 };
@@ -186,6 +181,7 @@ static struct omap_dss_device devkit8000_dvi_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_dvi,
        .platform_disable       = devkit8000_panel_disable_dvi,
 };
@@ -195,8 +191,6 @@ static struct omap_dss_device devkit8000_tv_device = {
        .driver_name            = "venc",
        .type                   = OMAP_DISPLAY_TYPE_VENC,
        .phy.venc.type          = OMAP_DSS_VENC_TYPE_SVIDEO,
-       .platform_enable        = devkit8000_panel_enable_tv,
-       .platform_disable       = devkit8000_panel_disable_tv,
 };
 
 
@@ -270,7 +264,21 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
 
        /* link regulators to MMC adapters */
        devkit8000_vmmc1_supply.dev = mmc[0].dev;
-       devkit8000_vsim_supply.dev = mmc[0].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");
+       /* Disable until needed */
+       gpio_direction_output(devkit8000_dvi_device.reset_gpio, 0);
 
        return 0;
 }
@@ -287,10 +295,6 @@ static struct twl4030_gpio_platform_data devkit8000_gpio_data = {
 };
 
 static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = {
-       {
-       .supply         = "vdvi",
-       .dev            = &devkit8000_lcd_device.dev,
-       },
        {
        .supply         = "vdds_dsi",
        .dev            = &devkit8000_dss_device.dev,
@@ -312,21 +316,6 @@ static struct regulator_init_data devkit8000_vmmc1 = {
        .consumer_supplies      = &devkit8000_vmmc1_supply,
 };
 
-/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
-static struct regulator_init_data devkit8000_vsim = {
-       .constraints = {
-               .min_uV                 = 1800000,
-               .max_uV                 = 3000000,
-               .valid_modes_mask       = REGULATOR_MODE_NORMAL
-                                       | REGULATOR_MODE_STANDBY,
-               .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
-                                       | REGULATOR_CHANGE_MODE
-                                       | REGULATOR_CHANGE_STATUS,
-       },
-       .num_consumer_supplies  = 1,
-       .consumer_supplies      = &devkit8000_vsim_supply,
-};
-
 /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
 static struct regulator_init_data devkit8000_vdac = {
        .constraints = {
@@ -344,7 +333,6 @@ static struct regulator_init_data devkit8000_vdac = {
 /* VPLL1 for digital video outputs */
 static struct regulator_init_data devkit8000_vpll1 = {
        .constraints = {
-               .name                   = "VDVI",
                .min_uV                 = 1800000,
                .max_uV                 = 1800000,
                .valid_modes_mask       = REGULATOR_MODE_NORMAL
@@ -393,7 +381,6 @@ static struct twl4030_platform_data devkit8000_twldata = {
        .gpio           = &devkit8000_gpio_data,
        .codec          = &devkit8000_codec_data,
        .vmmc1          = &devkit8000_vmmc1,
-       .vsim           = &devkit8000_vsim,
        .vdac           = &devkit8000_vdac,
        .vpll1          = &devkit8000_vpll1,
        .vio            = &devkit8000_vio,