aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-02-17 06:30:27 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-09 03:51:04 -0400
commite813a55eb9c9bc6c8039fb16332cf43402125b30 (patch)
tree18b4450d21ba7755587d442865142f641fee3f14
parent2da35193dc81b574001a47347f41c4922b1266d3 (diff)
OMAP: board-files: remove custom PD GPIO handling for DVI output
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>
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c32
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c19
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c24
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c24
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c26
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c31
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c23
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c23
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c33
-rw-r--r--arch/arm/mach-omap2/board-overo.c19
-rw-r--r--drivers/video/omap2/displays/panel-dvi.c13
-rw-r--r--include/video/omap-panel-dvi.h4
12 files changed, 14 insertions, 257 deletions
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index da75f239873e..d827f8b56431 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -113,9 +113,6 @@ static struct gpio sdp3430_dss_gpios[] __initdata = {
113 {SDP3430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD Backlight"}, 113 {SDP3430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD Backlight"},
114}; 114};
115 115
116static int lcd_enabled;
117static int dvi_enabled;
118
119static void __init sdp3430_display_init(void) 116static void __init sdp3430_display_init(void)
120{ 117{
121 int r; 118 int r;
@@ -129,44 +126,18 @@ static void __init sdp3430_display_init(void)
129 126
130static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev) 127static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
131{ 128{
132 if (dvi_enabled) {
133 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
134 return -EINVAL;
135 }
136
137 gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 1); 129 gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 1);
138 gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 1); 130 gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 1);
139 131
140 lcd_enabled = 1;
141
142 return 0; 132 return 0;
143} 133}
144 134
145static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev) 135static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
146{ 136{
147 lcd_enabled = 0;
148
149 gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 0); 137 gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 0);
150 gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 0); 138 gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 0);
151} 139}
152 140
153static int sdp3430_panel_enable_dvi(struct omap_dss_device *dssdev)
154{
155 if (lcd_enabled) {
156 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
157 return -EINVAL;
158 }
159
160 dvi_enabled = 1;
161
162 return 0;
163}
164
165static void sdp3430_panel_disable_dvi(struct omap_dss_device *dssdev)
166{
167 dvi_enabled = 0;
168}
169
170static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev) 141static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
171{ 142{
172 return 0; 143 return 0;
@@ -187,8 +158,7 @@ static struct omap_dss_device sdp3430_lcd_device = {
187}; 158};
188 159
189static struct panel_dvi_platform_data dvi_panel = { 160static struct panel_dvi_platform_data dvi_panel = {
190 .platform_enable = sdp3430_panel_enable_dvi, 161 .power_down_gpio = -1,
191 .platform_disable = sdp3430_panel_disable_dvi,
192}; 162};
193 163
194static struct omap_dss_device sdp3430_dvi_device = { 164static struct omap_dss_device sdp3430_dvi_device = {
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 3645285a3e2b..ce155bfc9838 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -207,25 +207,8 @@ static struct omap_dss_device am3517_evm_tv_device = {
207 .platform_disable = am3517_evm_panel_disable_tv, 207 .platform_disable = am3517_evm_panel_disable_tv,
208}; 208};
209 209
210static int am3517_evm_panel_enable_dvi(struct omap_dss_device *dssdev)
211{
212 if (lcd_enabled) {
213 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
214 return -EINVAL;
215 }
216 dvi_enabled = 1;
217
218 return 0;
219}
220
221static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev)
222{
223 dvi_enabled = 0;
224}
225
226static struct panel_dvi_platform_data dvi_panel = { 210static struct panel_dvi_platform_data dvi_panel = {
227 .platform_enable = am3517_evm_panel_enable_dvi, 211 .power_down_gpio = -1,
228 .platform_disable = am3517_evm_panel_disable_dvi,
229}; 212};
230 213
231static struct omap_dss_device am3517_evm_dvi_device = { 214static struct omap_dss_device am3517_evm_dvi_device = {
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 909a8b91b564..6f790262515c 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -218,25 +218,6 @@ static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev)
218 gpio_set_value(CM_T35_LCD_EN_GPIO, 0); 218 gpio_set_value(CM_T35_LCD_EN_GPIO, 0);
219} 219}
220 220
221static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev)
222{
223 if (lcd_enabled) {
224 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
225 return -EINVAL;
226 }
227
228 gpio_set_value(CM_T35_DVI_EN_GPIO, 0);
229 dvi_enabled = 1;
230
231 return 0;
232}
233
234static void cm_t35_panel_disable_dvi(struct omap_dss_device *dssdev)
235{
236 gpio_set_value(CM_T35_DVI_EN_GPIO, 1);
237 dvi_enabled = 0;
238}
239
240static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev) 221static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev)
241{ 222{
242 return 0; 223 return 0;
@@ -261,8 +242,7 @@ static struct omap_dss_device cm_t35_lcd_device = {
261}; 242};
262 243
263static struct panel_dvi_platform_data dvi_panel = { 244static struct panel_dvi_platform_data dvi_panel = {
264 .platform_enable = cm_t35_panel_enable_dvi, 245 .power_down_gpio = CM_T35_DVI_EN_GPIO,
265 .platform_disable = cm_t35_panel_disable_dvi,
266}; 246};
267 247
268static struct omap_dss_device cm_t35_dvi_device = { 248static struct omap_dss_device cm_t35_dvi_device = {
@@ -316,7 +296,6 @@ static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = {
316static struct gpio cm_t35_dss_gpios[] __initdata = { 296static struct gpio cm_t35_dss_gpios[] __initdata = {
317 { CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW, "lcd enable" }, 297 { CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW, "lcd enable" },
318 { CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW, "lcd bl enable" }, 298 { CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW, "lcd bl enable" },
319 { CM_T35_DVI_EN_GPIO, GPIOF_OUT_INIT_HIGH, "dvi enable" },
320}; 299};
321 300
322static void __init cm_t35_init_display(void) 301static void __init cm_t35_init_display(void)
@@ -335,7 +314,6 @@ static void __init cm_t35_init_display(void)
335 314
336 gpio_export(CM_T35_LCD_EN_GPIO, 0); 315 gpio_export(CM_T35_LCD_EN_GPIO, 0);
337 gpio_export(CM_T35_LCD_BL_GPIO, 0); 316 gpio_export(CM_T35_LCD_BL_GPIO, 0);
338 gpio_export(CM_T35_DVI_EN_GPIO, 0);
339 317
340 msleep(50); 318 msleep(50);
341 gpio_set_value(CM_T35_LCD_EN_GPIO, 1); 319 gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index a2010f07de31..92f79debbe92 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -118,19 +118,6 @@ static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
118 gpio_set_value_cansleep(dssdev->reset_gpio, 0); 118 gpio_set_value_cansleep(dssdev->reset_gpio, 0);
119} 119}
120 120
121static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
122{
123 if (gpio_is_valid(dssdev->reset_gpio))
124 gpio_set_value_cansleep(dssdev->reset_gpio, 1);
125 return 0;
126}
127
128static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
129{
130 if (gpio_is_valid(dssdev->reset_gpio))
131 gpio_set_value_cansleep(dssdev->reset_gpio, 0);
132}
133
134static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = { 121static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = {
135 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), 122 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
136}; 123};
@@ -155,8 +142,7 @@ static struct omap_dss_device devkit8000_lcd_device = {
155}; 142};
156 143
157static struct panel_dvi_platform_data dvi_panel = { 144static struct panel_dvi_platform_data dvi_panel = {
158 .platform_enable = devkit8000_panel_enable_dvi, 145 .power_down_gpio = -1,
159 .platform_disable = devkit8000_panel_disable_dvi,
160}; 146};
161 147
162static struct omap_dss_device devkit8000_dvi_device = { 148static struct omap_dss_device devkit8000_dvi_device = {
@@ -244,13 +230,7 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
244 } 230 }
245 231
246 /* gpio + 7 is "DVI_PD" (out, active low) */ 232 /* gpio + 7 is "DVI_PD" (out, active low) */
247 devkit8000_dvi_device.reset_gpio = gpio + 7; 233 dvi_panel.power_down_gpio = gpio + 7;
248 ret = gpio_request_one(devkit8000_dvi_device.reset_gpio,
249 GPIOF_OUT_INIT_LOW, "DVI PowerDown");
250 if (ret < 0) {
251 devkit8000_dvi_device.reset_gpio = -EINVAL;
252 printk(KERN_ERR "Failed to request GPIO for DVI PowerDown\n");
253 }
254 234
255 return 0; 235 return 0;
256} 236}
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 930c0d380435..c7028224d138 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -444,22 +444,9 @@ static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = {
444 .setup = igep_twl_gpio_setup, 444 .setup = igep_twl_gpio_setup,
445}; 445};
446 446
447static int igep2_enable_dvi(struct omap_dss_device *dssdev)
448{
449 gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1);
450
451 return 0;
452}
453
454static void igep2_disable_dvi(struct omap_dss_device *dssdev)
455{
456 gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0);
457}
458
459static struct panel_dvi_platform_data dvi_panel = { 447static struct panel_dvi_platform_data dvi_panel = {
460 .platform_enable = igep2_enable_dvi, 448 .i2c_bus_num = 3,
461 .platform_disable = igep2_disable_dvi, 449 .power_down_gpio = IGEP2_GPIO_DVI_PUP,
462 .i2c_bus_num = 3,
463}; 450};
464 451
465static struct omap_dss_device igep2_dvi_device = { 452static struct omap_dss_device igep2_dvi_device = {
@@ -480,14 +467,6 @@ static struct omap_dss_board_info igep2_dss_data = {
480 .default_device = &igep2_dvi_device, 467 .default_device = &igep2_dvi_device,
481}; 468};
482 469
483static void __init igep2_display_init(void)
484{
485 int err = gpio_request_one(IGEP2_GPIO_DVI_PUP, GPIOF_OUT_INIT_HIGH,
486 "GPIO_DVI_PUP");
487 if (err)
488 pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n");
489}
490
491static struct platform_device *igep_devices[] __initdata = { 470static struct platform_device *igep_devices[] __initdata = {
492 &igep_vwlan_device, 471 &igep_vwlan_device,
493}; 472};
@@ -668,7 +647,6 @@ static void __init igep_init(void)
668 647
669 if (machine_is_igep0020()) { 648 if (machine_is_igep0020()) {
670 omap_display_init(&igep2_dss_data); 649 omap_display_init(&igep2_dss_data);
671 igep2_display_init();
672 igep2_init_smsc911x(); 650 igep2_init_smsc911x();
673 usbhs_init(&igep2_usbhs_bdata); 651 usbhs_init(&igep2_usbhs_bdata);
674 } else { 652 } else {
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 7be8d659d91d..59f281f732f3 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -189,24 +189,9 @@ static struct mtd_partition omap3beagle_nand_partitions[] = {
189 189
190/* DSS */ 190/* DSS */
191 191
192static int beagle_enable_dvi(struct omap_dss_device *dssdev)
193{
194 if (gpio_is_valid(dssdev->reset_gpio))
195 gpio_set_value(dssdev->reset_gpio, 1);
196
197 return 0;
198}
199
200static void beagle_disable_dvi(struct omap_dss_device *dssdev)
201{
202 if (gpio_is_valid(dssdev->reset_gpio))
203 gpio_set_value(dssdev->reset_gpio, 0);
204}
205
206static struct panel_dvi_platform_data dvi_panel = { 192static struct panel_dvi_platform_data dvi_panel = {
207 .platform_enable = beagle_enable_dvi,
208 .platform_disable = beagle_disable_dvi,
209 .i2c_bus_num = 3, 193 .i2c_bus_num = 3,
194 .power_down_gpio = -1,
210}; 195};
211 196
212static struct omap_dss_device beagle_dvi_device = { 197static struct omap_dss_device beagle_dvi_device = {
@@ -215,7 +200,6 @@ static struct omap_dss_device beagle_dvi_device = {
215 .driver_name = "dvi", 200 .driver_name = "dvi",
216 .data = &dvi_panel, 201 .data = &dvi_panel,
217 .phy.dpi.data_lines = 24, 202 .phy.dpi.data_lines = 24,
218 .reset_gpio = -EINVAL,
219}; 203};
220 204
221static struct omap_dss_device beagle_tv_device = { 205static struct omap_dss_device beagle_tv_device = {
@@ -236,16 +220,6 @@ static struct omap_dss_board_info beagle_dss_data = {
236 .default_device = &beagle_dvi_device, 220 .default_device = &beagle_dvi_device,
237}; 221};
238 222
239static void __init beagle_display_init(void)
240{
241 int r;
242
243 r = gpio_request_one(beagle_dvi_device.reset_gpio, GPIOF_OUT_INIT_LOW,
244 "DVI reset");
245 if (r < 0)
246 printk(KERN_ERR "Unable to get DVI reset GPIO\n");
247}
248
249#include "sdram-micron-mt46h32m32lf-6.h" 223#include "sdram-micron-mt46h32m32lf-6.h"
250 224
251static struct omap2_hsmmc_info mmc[] = { 225static struct omap2_hsmmc_info mmc[] = {
@@ -309,7 +283,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
309 if (gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC")) 283 if (gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC"))
310 pr_err("%s: unable to configure EHCI_nOC\n", __func__); 284 pr_err("%s: unable to configure EHCI_nOC\n", __func__);
311 } 285 }
312 beagle_dvi_device.reset_gpio = beagle_config.reset_gpio; 286 dvi_panel.power_down_gpio = beagle_config.reset_gpio;
313 287
314 gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level, 288 gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level,
315 "nEN_USB_PWR"); 289 "nEN_USB_PWR");
@@ -552,7 +526,6 @@ static void __init omap3_beagle_init(void)
552 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 526 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
553 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); 527 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
554 528
555 beagle_display_init();
556 beagle_opp_init(); 529 beagle_opp_init();
557} 530}
558 531
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 49df12735b41..9a3bce54187b 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -219,29 +219,8 @@ static struct omap_dss_device omap3_evm_tv_device = {
219 .platform_disable = omap3_evm_disable_tv, 219 .platform_disable = omap3_evm_disable_tv,
220}; 220};
221 221
222static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev)
223{
224 if (lcd_enabled) {
225 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
226 return -EINVAL;
227 }
228
229 gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 1);
230
231 dvi_enabled = 1;
232 return 0;
233}
234
235static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev)
236{
237 gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 0);
238
239 dvi_enabled = 0;
240}
241
242static struct panel_dvi_platform_data dvi_panel = { 222static struct panel_dvi_platform_data dvi_panel = {
243 .platform_enable = omap3_evm_enable_dvi, 223 .power_down_gpio = OMAP3EVM_DVI_PANEL_EN_GPIO,
244 .platform_disable = omap3_evm_disable_dvi,
245}; 224};
246 225
247static struct omap_dss_device omap3_evm_dvi_device = { 226static struct omap_dss_device omap3_evm_dvi_device = {
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 4dffc95bddd2..de13f28ba269 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -92,9 +92,6 @@ static inline void __init omap3stalker_init_eth(void)
92#define LCD_PANEL_BKLIGHT_GPIO 210 92#define LCD_PANEL_BKLIGHT_GPIO 210
93#define ENABLE_VPLL2_DEV_GRP 0xE0 93#define ENABLE_VPLL2_DEV_GRP 0xE0
94 94
95static int lcd_enabled;
96static int dvi_enabled;
97
98static void __init omap3_stalker_display_init(void) 95static void __init omap3_stalker_display_init(void)
99{ 96{
100 return; 97 return;
@@ -122,26 +119,8 @@ static struct omap_dss_device omap3_stalker_tv_device = {
122 .platform_disable = omap3_stalker_disable_tv, 119 .platform_disable = omap3_stalker_disable_tv,
123}; 120};
124 121
125static int omap3_stalker_enable_dvi(struct omap_dss_device *dssdev)
126{
127 if (lcd_enabled) {
128 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
129 return -EINVAL;
130 }
131 gpio_set_value(DSS_ENABLE_GPIO, 1);
132 dvi_enabled = 1;
133 return 0;
134}
135
136static void omap3_stalker_disable_dvi(struct omap_dss_device *dssdev)
137{
138 gpio_set_value(DSS_ENABLE_GPIO, 0);
139 dvi_enabled = 0;
140}
141
142static struct panel_dvi_platform_data dvi_panel = { 122static struct panel_dvi_platform_data dvi_panel = {
143 .platform_enable = omap3_stalker_enable_dvi, 123 .power_down_gpio = DSS_ENABLE_GPIO,
144 .platform_disable = omap3_stalker_disable_dvi,
145}; 124};
146 125
147static struct omap_dss_device omap3_stalker_dvi_device = { 126static struct omap_dss_device omap3_stalker_dvi_device = {
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 1b782ba53433..ddf8253a7a0a 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -420,22 +420,10 @@ static struct omap_board_mux board_mux[] __initdata = {
420/* Display DVI */ 420/* Display DVI */
421#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0 421#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
422 422
423static int omap4_panda_enable_dvi(struct omap_dss_device *dssdev)
424{
425 gpio_set_value(dssdev->reset_gpio, 1);
426 return 0;
427}
428
429static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev)
430{
431 gpio_set_value(dssdev->reset_gpio, 0);
432}
433
434/* Using generic display panel */ 423/* Using generic display panel */
435static struct panel_dvi_platform_data omap4_dvi_panel = { 424static struct panel_dvi_platform_data omap4_dvi_panel = {
436 .platform_enable = omap4_panda_enable_dvi, 425 .i2c_bus_num = 3,
437 .platform_disable = omap4_panda_disable_dvi, 426 .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
438 .i2c_bus_num = 3,
439}; 427};
440 428
441struct omap_dss_device omap4_panda_dvi_device = { 429struct omap_dss_device omap4_panda_dvi_device = {
@@ -448,18 +436,6 @@ struct omap_dss_device omap4_panda_dvi_device = {
448 .channel = OMAP_DSS_CHANNEL_LCD2, 436 .channel = OMAP_DSS_CHANNEL_LCD2,
449}; 437};
450 438
451int __init omap4_panda_dvi_init(void)
452{
453 int r;
454
455 /* Requesting TFP410 DVI GPIO and disabling it, at bootup */
456 r = gpio_request_one(omap4_panda_dvi_device.reset_gpio,
457 GPIOF_OUT_INIT_LOW, "DVI PD");
458 if (r)
459 pr_err("Failed to get DVI powerdown GPIO\n");
460
461 return r;
462}
463 439
464static struct gpio panda_hdmi_gpios[] = { 440static struct gpio panda_hdmi_gpios[] = {
465 { HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" }, 441 { HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" },
@@ -511,11 +487,6 @@ static struct omap_dss_board_info omap4_panda_dss_data = {
511 487
512void __init omap4_panda_display_init(void) 488void __init omap4_panda_display_init(void)
513{ 489{
514 int r;
515
516 r = omap4_panda_dvi_init();
517 if (r)
518 pr_err("error initializing panda DVI\n");
519 490
520 omap_display_init(&omap4_panda_dss_data); 491 omap_display_init(&omap4_panda_dss_data);
521 492
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 33aa3910b09e..1a92fc42ea9a 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -167,26 +167,9 @@ static void __init overo_display_init(void)
167 gpio_export(OVERO_GPIO_LCD_BL, 0); 167 gpio_export(OVERO_GPIO_LCD_BL, 0);
168} 168}
169 169
170static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
171{
172 if (lcd_enabled) {
173 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
174 return -EINVAL;
175 }
176 dvi_enabled = 1;
177
178 return 0;
179}
180
181static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
182{
183 dvi_enabled = 0;
184}
185
186static struct panel_dvi_platform_data dvi_panel = { 170static struct panel_dvi_platform_data dvi_panel = {
187 .platform_enable = overo_panel_enable_dvi,
188 .platform_disable = overo_panel_disable_dvi,
189 .i2c_bus_num = 3, 171 .i2c_bus_num = 3,
172 .power_down_gpio = -1,
190}; 173};
191 174
192static struct omap_dss_device overo_dvi_device = { 175static struct omap_dss_device overo_dvi_device = {
diff --git a/drivers/video/omap2/displays/panel-dvi.c b/drivers/video/omap2/displays/panel-dvi.c
index 876b7989ecb4..7e8cadd42fec 100644
--- a/drivers/video/omap2/displays/panel-dvi.c
+++ b/drivers/video/omap2/displays/panel-dvi.c
@@ -58,7 +58,6 @@ static inline struct panel_dvi_platform_data
58static int panel_dvi_power_on(struct omap_dss_device *dssdev) 58static int panel_dvi_power_on(struct omap_dss_device *dssdev)
59{ 59{
60 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 60 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev);
61 struct panel_dvi_platform_data *pdata = get_pdata(dssdev);
62 int r; 61 int r;
63 62
64 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 63 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
@@ -68,18 +67,10 @@ static int panel_dvi_power_on(struct omap_dss_device *dssdev)
68 if (r) 67 if (r)
69 goto err0; 68 goto err0;
70 69
71 if (pdata->platform_enable) {
72 r = pdata->platform_enable(dssdev);
73 if (r)
74 goto err1;
75 }
76
77 if (gpio_is_valid(ddata->pd_gpio)) 70 if (gpio_is_valid(ddata->pd_gpio))
78 gpio_set_value(ddata->pd_gpio, 1); 71 gpio_set_value(ddata->pd_gpio, 1);
79 72
80 return 0; 73 return 0;
81err1:
82 omapdss_dpi_display_disable(dssdev);
83err0: 74err0:
84 return r; 75 return r;
85} 76}
@@ -87,7 +78,6 @@ err0:
87static void panel_dvi_power_off(struct omap_dss_device *dssdev) 78static void panel_dvi_power_off(struct omap_dss_device *dssdev)
88{ 79{
89 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 80 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev);
90 struct panel_dvi_platform_data *pdata = get_pdata(dssdev);
91 81
92 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 82 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
93 return; 83 return;
@@ -95,9 +85,6 @@ static void panel_dvi_power_off(struct omap_dss_device *dssdev)
95 if (gpio_is_valid(ddata->pd_gpio)) 85 if (gpio_is_valid(ddata->pd_gpio))
96 gpio_set_value(ddata->pd_gpio, 0); 86 gpio_set_value(ddata->pd_gpio, 0);
97 87
98 if (pdata->platform_disable)
99 pdata->platform_disable(dssdev);
100
101 omapdss_dpi_display_disable(dssdev); 88 omapdss_dpi_display_disable(dssdev);
102} 89}
103 90
diff --git a/include/video/omap-panel-dvi.h b/include/video/omap-panel-dvi.h
index 4ad41fcc809c..a782124b9379 100644
--- a/include/video/omap-panel-dvi.h
+++ b/include/video/omap-panel-dvi.h
@@ -24,14 +24,10 @@ struct omap_dss_device;
24 24
25/** 25/**
26 * struct panel_dvi_platform_data - panel driver configuration data 26 * struct panel_dvi_platform_data - panel driver configuration data
27 * @platform_enable: platform specific panel enable function
28 * @platform_disable: platform specific panel disable function
29 * @i2c_bus_num: i2c bus id for the panel 27 * @i2c_bus_num: i2c bus id for the panel
30 * @power_down_gpio: gpio number for PD pin (or -1 if not available) 28 * @power_down_gpio: gpio number for PD pin (or -1 if not available)
31 */ 29 */
32struct panel_dvi_platform_data { 30struct panel_dvi_platform_data {
33 int (*platform_enable)(struct omap_dss_device *dssdev);
34 void (*platform_disable)(struct omap_dss_device *dssdev);
35 u16 i2c_bus_num; 31 u16 i2c_bus_num;
36 int power_down_gpio; 32 int power_down_gpio;
37}; 33};