OMAP2: Devkit8000: Remove en-/disable for tv panel
[pandora-kernel.git] / arch / arm / mach-omap2 / board-devkit8000.c
index 77022b5..13ce242 100644 (file)
@@ -134,46 +134,45 @@ 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")
 };
 
-
 static struct omap_dss_device devkit8000_lcd_device = {
        .name                   = "lcd",
-       .driver_name            = "innolux_at_panel",
+       .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,
 };
@@ -182,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,
 };
@@ -191,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,
 };
 
 
@@ -266,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;
 }
@@ -282,11 +294,7 @@ static struct twl4030_gpio_platform_data devkit8000_gpio_data = {
        .setup          = devkit8000_twl_gpio_setup,
 };
 
-static struct regulator_consumer_supply devkit8000_vpll2_supplies[] = {
-       {
-       .supply         = "vdvi",
-       .dev            = &devkit8000_lcd_device.dev,
-       },
+static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = {
        {
        .supply         = "vdds_dsi",
        .dev            = &devkit8000_dss_device.dev,
@@ -308,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 = {
@@ -337,10 +330,9 @@ static struct regulator_init_data devkit8000_vdac = {
        .consumer_supplies      = &devkit8000_vdda_dac_supply,
 };
 
-/* VPLL2 for digital video outputs */
-static struct regulator_init_data devkit8000_vpll2 = {
+/* 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
@@ -348,8 +340,23 @@ static struct regulator_init_data devkit8000_vpll2 = {
                .valid_ops_mask         = REGULATOR_CHANGE_MODE
                                        | REGULATOR_CHANGE_STATUS,
        },
-       .num_consumer_supplies  = ARRAY_SIZE(devkit8000_vpll2_supplies),
-       .consumer_supplies      = devkit8000_vpll2_supplies,
+       .num_consumer_supplies  = ARRAY_SIZE(devkit8000_vpll1_supplies),
+       .consumer_supplies      = devkit8000_vpll1_supplies,
+};
+
+/* VAUX4 for ads7846 and nubs */
+static struct regulator_init_data devkit8000_vio = {
+       .constraints = {
+               .min_uV                 = 1800000,
+               .max_uV                 = 1800000,
+               .apply_uV               = true,
+               .valid_modes_mask       = REGULATOR_MODE_NORMAL
+                       | REGULATOR_MODE_STANDBY,
+               .valid_ops_mask         = REGULATOR_CHANGE_MODE
+                       | REGULATOR_CHANGE_STATUS,
+       },
+       .num_consumer_supplies  = ARRAY_SIZE(devkit8000_vio_supplies),
+       .consumer_supplies      = devkit8000_vio_supplies,
 };
 
 static struct twl4030_usb_data devkit8000_usb_data = {
@@ -374,9 +381,9 @@ static struct twl4030_platform_data devkit8000_twldata = {
        .gpio           = &devkit8000_gpio_data,
        .codec          = &devkit8000_codec_data,
        .vmmc1          = &devkit8000_vmmc1,
-       .vsim           = &devkit8000_vsim,
        .vdac           = &devkit8000_vdac,
-       .vpll2          = &devkit8000_vpll2,
+       .vpll1          = &devkit8000_vpll1,
+       .vio            = &devkit8000_vio,
        .keypad         = &devkit8000_kp_data,
 };