Skip to content

Commit

Permalink
OMAP: board-files: remove custom PD GPIO handling for DVI output
Browse files Browse the repository at this point in the history
Now that the panel-dvi driver handles the PD (power-down) GPIO, we can
remove the custom PD handling from the board files.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Tomi Valkeinen committed May 9, 2012
1 parent 2da3519 commit e813a55
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 257 deletions.
32 changes: 1 addition & 31 deletions arch/arm/mach-omap2/board-3430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ static struct gpio sdp3430_dss_gpios[] __initdata = {
{SDP3430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD Backlight"},
};

static int lcd_enabled;
static int dvi_enabled;

static void __init sdp3430_display_init(void)
{
int r;
Expand All @@ -129,44 +126,18 @@ static void __init sdp3430_display_init(void)

static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
{
if (dvi_enabled) {
printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
return -EINVAL;
}

gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 1);
gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 1);

lcd_enabled = 1;

return 0;
}

static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
{
lcd_enabled = 0;

gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 0);
gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 0);
}

static int sdp3430_panel_enable_dvi(struct omap_dss_device *dssdev)
{
if (lcd_enabled) {
printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
return -EINVAL;
}

dvi_enabled = 1;

return 0;
}

static void sdp3430_panel_disable_dvi(struct omap_dss_device *dssdev)
{
dvi_enabled = 0;
}

static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
{
return 0;
Expand All @@ -187,8 +158,7 @@ static struct omap_dss_device sdp3430_lcd_device = {
};

static struct panel_dvi_platform_data dvi_panel = {
.platform_enable = sdp3430_panel_enable_dvi,
.platform_disable = sdp3430_panel_disable_dvi,
.power_down_gpio = -1,
};

static struct omap_dss_device sdp3430_dvi_device = {
Expand Down
19 changes: 1 addition & 18 deletions arch/arm/mach-omap2/board-am3517evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,25 +207,8 @@ static struct omap_dss_device am3517_evm_tv_device = {
.platform_disable = am3517_evm_panel_disable_tv,
};

static int am3517_evm_panel_enable_dvi(struct omap_dss_device *dssdev)
{
if (lcd_enabled) {
printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
return -EINVAL;
}
dvi_enabled = 1;

return 0;
}

static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev)
{
dvi_enabled = 0;
}

static struct panel_dvi_platform_data dvi_panel = {
.platform_enable = am3517_evm_panel_enable_dvi,
.platform_disable = am3517_evm_panel_disable_dvi,
.power_down_gpio = -1,
};

static struct omap_dss_device am3517_evm_dvi_device = {
Expand Down
24 changes: 1 addition & 23 deletions arch/arm/mach-omap2/board-cm-t35.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,25 +218,6 @@ static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev)
gpio_set_value(CM_T35_LCD_EN_GPIO, 0);
}

static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev)
{
if (lcd_enabled) {
printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
return -EINVAL;
}

gpio_set_value(CM_T35_DVI_EN_GPIO, 0);
dvi_enabled = 1;

return 0;
}

static void cm_t35_panel_disable_dvi(struct omap_dss_device *dssdev)
{
gpio_set_value(CM_T35_DVI_EN_GPIO, 1);
dvi_enabled = 0;
}

static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev)
{
return 0;
Expand All @@ -261,8 +242,7 @@ static struct omap_dss_device cm_t35_lcd_device = {
};

static struct panel_dvi_platform_data dvi_panel = {
.platform_enable = cm_t35_panel_enable_dvi,
.platform_disable = cm_t35_panel_disable_dvi,
.power_down_gpio = CM_T35_DVI_EN_GPIO,
};

static struct omap_dss_device cm_t35_dvi_device = {
Expand Down Expand Up @@ -316,7 +296,6 @@ static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = {
static struct gpio cm_t35_dss_gpios[] __initdata = {
{ CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW, "lcd enable" },
{ CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW, "lcd bl enable" },
{ CM_T35_DVI_EN_GPIO, GPIOF_OUT_INIT_HIGH, "dvi enable" },
};

static void __init cm_t35_init_display(void)
Expand All @@ -335,7 +314,6 @@ static void __init cm_t35_init_display(void)

gpio_export(CM_T35_LCD_EN_GPIO, 0);
gpio_export(CM_T35_LCD_BL_GPIO, 0);
gpio_export(CM_T35_DVI_EN_GPIO, 0);

msleep(50);
gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
Expand Down
24 changes: 2 additions & 22 deletions arch/arm/mach-omap2/board-devkit8000.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,6 @@ static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
gpio_set_value_cansleep(dssdev->reset_gpio, 0);
}

static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(dssdev->reset_gpio))
gpio_set_value_cansleep(dssdev->reset_gpio, 1);
return 0;
}

static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(dssdev->reset_gpio))
gpio_set_value_cansleep(dssdev->reset_gpio, 0);
}

static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = {
REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
};
Expand All @@ -155,8 +142,7 @@ static struct omap_dss_device devkit8000_lcd_device = {
};

static struct panel_dvi_platform_data dvi_panel = {
.platform_enable = devkit8000_panel_enable_dvi,
.platform_disable = devkit8000_panel_disable_dvi,
.power_down_gpio = -1,
};

static struct omap_dss_device devkit8000_dvi_device = {
Expand Down Expand Up @@ -244,13 +230,7 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
}

/* gpio + 7 is "DVI_PD" (out, active low) */
devkit8000_dvi_device.reset_gpio = gpio + 7;
ret = gpio_request_one(devkit8000_dvi_device.reset_gpio,
GPIOF_OUT_INIT_LOW, "DVI PowerDown");
if (ret < 0) {
devkit8000_dvi_device.reset_gpio = -EINVAL;
printk(KERN_ERR "Failed to request GPIO for DVI PowerDown\n");
}
dvi_panel.power_down_gpio = gpio + 7;

return 0;
}
Expand Down
26 changes: 2 additions & 24 deletions arch/arm/mach-omap2/board-igep0020.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,22 +444,9 @@ static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = {
.setup = igep_twl_gpio_setup,
};

static int igep2_enable_dvi(struct omap_dss_device *dssdev)
{
gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1);

return 0;
}

static void igep2_disable_dvi(struct omap_dss_device *dssdev)
{
gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0);
}

static struct panel_dvi_platform_data dvi_panel = {
.platform_enable = igep2_enable_dvi,
.platform_disable = igep2_disable_dvi,
.i2c_bus_num = 3,
.i2c_bus_num = 3,
.power_down_gpio = IGEP2_GPIO_DVI_PUP,
};

static struct omap_dss_device igep2_dvi_device = {
Expand All @@ -480,14 +467,6 @@ static struct omap_dss_board_info igep2_dss_data = {
.default_device = &igep2_dvi_device,
};

static void __init igep2_display_init(void)
{
int err = gpio_request_one(IGEP2_GPIO_DVI_PUP, GPIOF_OUT_INIT_HIGH,
"GPIO_DVI_PUP");
if (err)
pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n");
}

static struct platform_device *igep_devices[] __initdata = {
&igep_vwlan_device,
};
Expand Down Expand Up @@ -668,7 +647,6 @@ static void __init igep_init(void)

if (machine_is_igep0020()) {
omap_display_init(&igep2_dss_data);
igep2_display_init();
igep2_init_smsc911x();
usbhs_init(&igep2_usbhs_bdata);
} else {
Expand Down
31 changes: 2 additions & 29 deletions arch/arm/mach-omap2/board-omap3beagle.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,24 +189,9 @@ static struct mtd_partition omap3beagle_nand_partitions[] = {

/* DSS */

static int beagle_enable_dvi(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(dssdev->reset_gpio))
gpio_set_value(dssdev->reset_gpio, 1);

return 0;
}

static void beagle_disable_dvi(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(dssdev->reset_gpio))
gpio_set_value(dssdev->reset_gpio, 0);
}

static struct panel_dvi_platform_data dvi_panel = {
.platform_enable = beagle_enable_dvi,
.platform_disable = beagle_disable_dvi,
.i2c_bus_num = 3,
.power_down_gpio = -1,
};

static struct omap_dss_device beagle_dvi_device = {
Expand All @@ -215,7 +200,6 @@ static struct omap_dss_device beagle_dvi_device = {
.driver_name = "dvi",
.data = &dvi_panel,
.phy.dpi.data_lines = 24,
.reset_gpio = -EINVAL,
};

static struct omap_dss_device beagle_tv_device = {
Expand All @@ -236,16 +220,6 @@ static struct omap_dss_board_info beagle_dss_data = {
.default_device = &beagle_dvi_device,
};

static void __init beagle_display_init(void)
{
int r;

r = gpio_request_one(beagle_dvi_device.reset_gpio, GPIOF_OUT_INIT_LOW,
"DVI reset");
if (r < 0)
printk(KERN_ERR "Unable to get DVI reset GPIO\n");
}

#include "sdram-micron-mt46h32m32lf-6.h"

static struct omap2_hsmmc_info mmc[] = {
Expand Down Expand Up @@ -309,7 +283,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
if (gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC"))
pr_err("%s: unable to configure EHCI_nOC\n", __func__);
}
beagle_dvi_device.reset_gpio = beagle_config.reset_gpio;
dvi_panel.power_down_gpio = beagle_config.reset_gpio;

gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level,
"nEN_USB_PWR");
Expand Down Expand Up @@ -552,7 +526,6 @@ static void __init omap3_beagle_init(void)
omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);

beagle_display_init();
beagle_opp_init();
}

Expand Down
23 changes: 1 addition & 22 deletions arch/arm/mach-omap2/board-omap3evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,29 +219,8 @@ static struct omap_dss_device omap3_evm_tv_device = {
.platform_disable = omap3_evm_disable_tv,
};

static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev)
{
if (lcd_enabled) {
printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
return -EINVAL;
}

gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 1);

dvi_enabled = 1;
return 0;
}

static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev)
{
gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 0);

dvi_enabled = 0;
}

static struct panel_dvi_platform_data dvi_panel = {
.platform_enable = omap3_evm_enable_dvi,
.platform_disable = omap3_evm_disable_dvi,
.power_down_gpio = OMAP3EVM_DVI_PANEL_EN_GPIO,
};

static struct omap_dss_device omap3_evm_dvi_device = {
Expand Down
23 changes: 1 addition & 22 deletions arch/arm/mach-omap2/board-omap3stalker.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ static inline void __init omap3stalker_init_eth(void)
#define LCD_PANEL_BKLIGHT_GPIO 210
#define ENABLE_VPLL2_DEV_GRP 0xE0

static int lcd_enabled;
static int dvi_enabled;

static void __init omap3_stalker_display_init(void)
{
return;
Expand Down Expand Up @@ -122,26 +119,8 @@ static struct omap_dss_device omap3_stalker_tv_device = {
.platform_disable = omap3_stalker_disable_tv,
};

static int omap3_stalker_enable_dvi(struct omap_dss_device *dssdev)
{
if (lcd_enabled) {
printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
return -EINVAL;
}
gpio_set_value(DSS_ENABLE_GPIO, 1);
dvi_enabled = 1;
return 0;
}

static void omap3_stalker_disable_dvi(struct omap_dss_device *dssdev)
{
gpio_set_value(DSS_ENABLE_GPIO, 0);
dvi_enabled = 0;
}

static struct panel_dvi_platform_data dvi_panel = {
.platform_enable = omap3_stalker_enable_dvi,
.platform_disable = omap3_stalker_disable_dvi,
.power_down_gpio = DSS_ENABLE_GPIO,
};

static struct omap_dss_device omap3_stalker_dvi_device = {
Expand Down
Loading

0 comments on commit e813a55

Please sign in to comment.