diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-10 12:55:44 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-10 13:24:14 -0400 |
commit | 9b71fb5cbcdd83c65e5fe6db9cd12246f7ea0262 (patch) | |
tree | d034047d7cd562700c59a0b1b3ba707367939fe7 | |
parent | 1dfafbc655b3723e37120d4b30e82d1c87767dd1 (diff) | |
parent | e4a9e94cc58ed6e4efb02b80be3a9bf57f448d07 (diff) |
Merge branch 'for-l-o-3.5'
Conflicts:
drivers/video/omap2/displays/panel-taal.c
Merge OMAP DSS related board file changes. The branch will also be
merged through linux-omap tree to solve conflicts.
19 files changed, 251 insertions, 448 deletions
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index da75f239873e..37abb0d49b51 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <plat/dma.h> | 37 | #include <plat/dma.h> |
38 | #include <plat/gpmc.h> | 38 | #include <plat/gpmc.h> |
39 | #include <video/omapdss.h> | 39 | #include <video/omapdss.h> |
40 | #include <video/omap-panel-dvi.h> | 40 | #include <video/omap-panel-tfp410.h> |
41 | 41 | ||
42 | #include <plat/gpmc-smc91x.h> | 42 | #include <plat/gpmc-smc91x.h> |
43 | 43 | ||
@@ -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 | ||
116 | static int lcd_enabled; | ||
117 | static int dvi_enabled; | ||
118 | |||
119 | static void __init sdp3430_display_init(void) | 116 | static 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 | ||
130 | static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev) | 127 | static 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 | ||
145 | static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev) | 135 | static 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 | ||
153 | static 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 | |||
165 | static void sdp3430_panel_disable_dvi(struct omap_dss_device *dssdev) | ||
166 | { | ||
167 | dvi_enabled = 0; | ||
168 | } | ||
169 | |||
170 | static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev) | 141 | static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev) |
171 | { | 142 | { |
172 | return 0; | 143 | return 0; |
@@ -186,15 +157,14 @@ static struct omap_dss_device sdp3430_lcd_device = { | |||
186 | .platform_disable = sdp3430_panel_disable_lcd, | 157 | .platform_disable = sdp3430_panel_disable_lcd, |
187 | }; | 158 | }; |
188 | 159 | ||
189 | static struct panel_dvi_platform_data dvi_panel = { | 160 | static struct tfp410_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 | ||
194 | static struct omap_dss_device sdp3430_dvi_device = { | 164 | static struct omap_dss_device sdp3430_dvi_device = { |
195 | .name = "dvi", | 165 | .name = "dvi", |
196 | .type = OMAP_DISPLAY_TYPE_DPI, | 166 | .type = OMAP_DISPLAY_TYPE_DPI, |
197 | .driver_name = "dvi", | 167 | .driver_name = "tfp410", |
198 | .data = &dvi_panel, | 168 | .data = &dvi_panel, |
199 | .phy.dpi.data_lines = 24, | 169 | .phy.dpi.data_lines = 24, |
200 | }; | 170 | }; |
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 130ab00c09a2..b4ad706c145a 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -666,6 +666,10 @@ static struct nokia_dsi_panel_data dsi1_panel = { | |||
666 | .use_ext_te = false, | 666 | .use_ext_te = false, |
667 | .ext_te_gpio = 101, | 667 | .ext_te_gpio = 101, |
668 | .esd_interval = 0, | 668 | .esd_interval = 0, |
669 | .pin_config = { | ||
670 | .num_pins = 6, | ||
671 | .pins = { 0, 1, 2, 3, 4, 5 }, | ||
672 | }, | ||
669 | }; | 673 | }; |
670 | 674 | ||
671 | static struct omap_dss_device sdp4430_lcd_device = { | 675 | static struct omap_dss_device sdp4430_lcd_device = { |
@@ -674,13 +678,6 @@ static struct omap_dss_device sdp4430_lcd_device = { | |||
674 | .type = OMAP_DISPLAY_TYPE_DSI, | 678 | .type = OMAP_DISPLAY_TYPE_DSI, |
675 | .data = &dsi1_panel, | 679 | .data = &dsi1_panel, |
676 | .phy.dsi = { | 680 | .phy.dsi = { |
677 | .clk_lane = 1, | ||
678 | .clk_pol = 0, | ||
679 | .data1_lane = 2, | ||
680 | .data1_pol = 0, | ||
681 | .data2_lane = 3, | ||
682 | .data2_pol = 0, | ||
683 | |||
684 | .module = 0, | 681 | .module = 0, |
685 | }, | 682 | }, |
686 | 683 | ||
@@ -715,6 +712,10 @@ static struct nokia_dsi_panel_data dsi2_panel = { | |||
715 | .use_ext_te = false, | 712 | .use_ext_te = false, |
716 | .ext_te_gpio = 103, | 713 | .ext_te_gpio = 103, |
717 | .esd_interval = 0, | 714 | .esd_interval = 0, |
715 | .pin_config = { | ||
716 | .num_pins = 6, | ||
717 | .pins = { 0, 1, 2, 3, 4, 5 }, | ||
718 | }, | ||
718 | }; | 719 | }; |
719 | 720 | ||
720 | static struct omap_dss_device sdp4430_lcd2_device = { | 721 | static struct omap_dss_device sdp4430_lcd2_device = { |
@@ -723,12 +724,6 @@ static struct omap_dss_device sdp4430_lcd2_device = { | |||
723 | .type = OMAP_DISPLAY_TYPE_DSI, | 724 | .type = OMAP_DISPLAY_TYPE_DSI, |
724 | .data = &dsi2_panel, | 725 | .data = &dsi2_panel, |
725 | .phy.dsi = { | 726 | .phy.dsi = { |
726 | .clk_lane = 1, | ||
727 | .clk_pol = 0, | ||
728 | .data1_lane = 2, | ||
729 | .data1_pol = 0, | ||
730 | .data2_lane = 3, | ||
731 | .data2_pol = 0, | ||
732 | 727 | ||
733 | .module = 1, | 728 | .module = 1, |
734 | }, | 729 | }, |
@@ -758,21 +753,6 @@ static struct omap_dss_device sdp4430_lcd2_device = { | |||
758 | .channel = OMAP_DSS_CHANNEL_LCD2, | 753 | .channel = OMAP_DSS_CHANNEL_LCD2, |
759 | }; | 754 | }; |
760 | 755 | ||
761 | static void sdp4430_lcd_init(void) | ||
762 | { | ||
763 | int r; | ||
764 | |||
765 | r = gpio_request_one(dsi1_panel.reset_gpio, GPIOF_DIR_OUT, | ||
766 | "lcd1_reset_gpio"); | ||
767 | if (r) | ||
768 | pr_err("%s: Could not get lcd1_reset_gpio\n", __func__); | ||
769 | |||
770 | r = gpio_request_one(dsi2_panel.reset_gpio, GPIOF_DIR_OUT, | ||
771 | "lcd2_reset_gpio"); | ||
772 | if (r) | ||
773 | pr_err("%s: Could not get lcd2_reset_gpio\n", __func__); | ||
774 | } | ||
775 | |||
776 | static struct omap_dss_hdmi_data sdp4430_hdmi_data = { | 756 | static struct omap_dss_hdmi_data sdp4430_hdmi_data = { |
777 | .hpd_gpio = HDMI_GPIO_HPD, | 757 | .hpd_gpio = HDMI_GPIO_HPD, |
778 | }; | 758 | }; |
@@ -858,7 +838,6 @@ static void __init omap_4430sdp_display_init(void) | |||
858 | if (r) | 838 | if (r) |
859 | pr_err("%s: Could not get display_sel GPIO\n", __func__); | 839 | pr_err("%s: Could not get display_sel GPIO\n", __func__); |
860 | 840 | ||
861 | sdp4430_lcd_init(); | ||
862 | sdp4430_picodlp_init(); | 841 | sdp4430_picodlp_init(); |
863 | omap_display_init(&sdp4430_dss_data); | 842 | omap_display_init(&sdp4430_dss_data); |
864 | /* | 843 | /* |
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 3645285a3e2b..99790eb646e8 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <plat/usb.h> | 37 | #include <plat/usb.h> |
38 | #include <video/omapdss.h> | 38 | #include <video/omapdss.h> |
39 | #include <video/omap-panel-generic-dpi.h> | 39 | #include <video/omap-panel-generic-dpi.h> |
40 | #include <video/omap-panel-dvi.h> | 40 | #include <video/omap-panel-tfp410.h> |
41 | 41 | ||
42 | #include "am35xx-emac.h" | 42 | #include "am35xx-emac.h" |
43 | #include "mux.h" | 43 | #include "mux.h" |
@@ -207,31 +207,14 @@ 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 | ||
210 | static int am3517_evm_panel_enable_dvi(struct omap_dss_device *dssdev) | 210 | static struct tfp410_platform_data dvi_panel = { |
211 | { | 211 | .power_down_gpio = -1, |
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 | |||
221 | static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) | ||
222 | { | ||
223 | dvi_enabled = 0; | ||
224 | } | ||
225 | |||
226 | static struct panel_dvi_platform_data dvi_panel = { | ||
227 | .platform_enable = am3517_evm_panel_enable_dvi, | ||
228 | .platform_disable = am3517_evm_panel_disable_dvi, | ||
229 | }; | 212 | }; |
230 | 213 | ||
231 | static struct omap_dss_device am3517_evm_dvi_device = { | 214 | static struct omap_dss_device am3517_evm_dvi_device = { |
232 | .type = OMAP_DISPLAY_TYPE_DPI, | 215 | .type = OMAP_DISPLAY_TYPE_DPI, |
233 | .name = "dvi", | 216 | .name = "dvi", |
234 | .driver_name = "dvi", | 217 | .driver_name = "tfp410", |
235 | .data = &dvi_panel, | 218 | .data = &dvi_panel, |
236 | .phy.dpi.data_lines = 24, | 219 | .phy.dpi.data_lines = 24, |
237 | }; | 220 | }; |
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 909a8b91b564..45746cb56c68 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #include <plat/usb.h> | 44 | #include <plat/usb.h> |
45 | #include <video/omapdss.h> | 45 | #include <video/omapdss.h> |
46 | #include <video/omap-panel-generic-dpi.h> | 46 | #include <video/omap-panel-generic-dpi.h> |
47 | #include <video/omap-panel-dvi.h> | 47 | #include <video/omap-panel-tfp410.h> |
48 | #include <plat/mcspi.h> | 48 | #include <plat/mcspi.h> |
49 | 49 | ||
50 | #include <mach/hardware.h> | 50 | #include <mach/hardware.h> |
@@ -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 | ||
221 | static 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 | |||
234 | static 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 | |||
240 | static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev) | 221 | static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev) |
241 | { | 222 | { |
242 | return 0; | 223 | return 0; |
@@ -260,15 +241,14 @@ static struct omap_dss_device cm_t35_lcd_device = { | |||
260 | .phy.dpi.data_lines = 18, | 241 | .phy.dpi.data_lines = 18, |
261 | }; | 242 | }; |
262 | 243 | ||
263 | static struct panel_dvi_platform_data dvi_panel = { | 244 | static struct tfp410_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 | ||
268 | static struct omap_dss_device cm_t35_dvi_device = { | 248 | static struct omap_dss_device cm_t35_dvi_device = { |
269 | .name = "dvi", | 249 | .name = "dvi", |
270 | .type = OMAP_DISPLAY_TYPE_DPI, | 250 | .type = OMAP_DISPLAY_TYPE_DPI, |
271 | .driver_name = "dvi", | 251 | .driver_name = "tfp410", |
272 | .data = &dvi_panel, | 252 | .data = &dvi_panel, |
273 | .phy.dpi.data_lines = 24, | 253 | .phy.dpi.data_lines = 24, |
274 | }; | 254 | }; |
@@ -316,7 +296,6 @@ static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = { | |||
316 | static struct gpio cm_t35_dss_gpios[] __initdata = { | 296 | static 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 | ||
322 | static void __init cm_t35_init_display(void) | 301 | static 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..b063f0d2faa6 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
@@ -47,7 +47,7 @@ | |||
47 | #include <plat/usb.h> | 47 | #include <plat/usb.h> |
48 | #include <video/omapdss.h> | 48 | #include <video/omapdss.h> |
49 | #include <video/omap-panel-generic-dpi.h> | 49 | #include <video/omap-panel-generic-dpi.h> |
50 | #include <video/omap-panel-dvi.h> | 50 | #include <video/omap-panel-tfp410.h> |
51 | 51 | ||
52 | #include <plat/mcspi.h> | 52 | #include <plat/mcspi.h> |
53 | #include <linux/input/matrix_keypad.h> | 53 | #include <linux/input/matrix_keypad.h> |
@@ -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 | ||
121 | static 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 | |||
128 | static 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 | |||
134 | static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = { | 121 | static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = { |
135 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), | 122 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
136 | }; | 123 | }; |
@@ -154,15 +141,14 @@ static struct omap_dss_device devkit8000_lcd_device = { | |||
154 | .phy.dpi.data_lines = 24, | 141 | .phy.dpi.data_lines = 24, |
155 | }; | 142 | }; |
156 | 143 | ||
157 | static struct panel_dvi_platform_data dvi_panel = { | 144 | static struct tfp410_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 | ||
162 | static struct omap_dss_device devkit8000_dvi_device = { | 148 | static struct omap_dss_device devkit8000_dvi_device = { |
163 | .name = "dvi", | 149 | .name = "dvi", |
164 | .type = OMAP_DISPLAY_TYPE_DPI, | 150 | .type = OMAP_DISPLAY_TYPE_DPI, |
165 | .driver_name = "dvi", | 151 | .driver_name = "tfp410", |
166 | .data = &dvi_panel, | 152 | .data = &dvi_panel, |
167 | .phy.dpi.data_lines = 24, | 153 | .phy.dpi.data_lines = 24, |
168 | }; | 154 | }; |
@@ -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..04816c96e829 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <plat/gpmc.h> | 32 | #include <plat/gpmc.h> |
33 | #include <plat/usb.h> | 33 | #include <plat/usb.h> |
34 | #include <video/omapdss.h> | 34 | #include <video/omapdss.h> |
35 | #include <video/omap-panel-dvi.h> | 35 | #include <video/omap-panel-tfp410.h> |
36 | #include <plat/onenand.h> | 36 | #include <plat/onenand.h> |
37 | 37 | ||
38 | #include "mux.h" | 38 | #include "mux.h" |
@@ -444,28 +444,15 @@ 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 | ||
447 | static int igep2_enable_dvi(struct omap_dss_device *dssdev) | 447 | static struct tfp410_platform_data dvi_panel = { |
448 | { | 448 | .i2c_bus_num = 3, |
449 | gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1); | 449 | .power_down_gpio = IGEP2_GPIO_DVI_PUP, |
450 | |||
451 | return 0; | ||
452 | } | ||
453 | |||
454 | static void igep2_disable_dvi(struct omap_dss_device *dssdev) | ||
455 | { | ||
456 | gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0); | ||
457 | } | ||
458 | |||
459 | static struct panel_dvi_platform_data dvi_panel = { | ||
460 | .platform_enable = igep2_enable_dvi, | ||
461 | .platform_disable = igep2_disable_dvi, | ||
462 | .i2c_bus_num = 3, | ||
463 | }; | 450 | }; |
464 | 451 | ||
465 | static struct omap_dss_device igep2_dvi_device = { | 452 | static struct omap_dss_device igep2_dvi_device = { |
466 | .type = OMAP_DISPLAY_TYPE_DPI, | 453 | .type = OMAP_DISPLAY_TYPE_DPI, |
467 | .name = "dvi", | 454 | .name = "dvi", |
468 | .driver_name = "dvi", | 455 | .driver_name = "tfp410", |
469 | .data = &dvi_panel, | 456 | .data = &dvi_panel, |
470 | .phy.dpi.data_lines = 24, | 457 | .phy.dpi.data_lines = 24, |
471 | }; | 458 | }; |
@@ -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 | ||
483 | static 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 | |||
491 | static struct platform_device *igep_devices[] __initdata = { | 470 | static 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..8ede8d20d7b2 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include <plat/board.h> | 42 | #include <plat/board.h> |
43 | #include "common.h" | 43 | #include "common.h" |
44 | #include <video/omapdss.h> | 44 | #include <video/omapdss.h> |
45 | #include <video/omap-panel-dvi.h> | 45 | #include <video/omap-panel-tfp410.h> |
46 | #include <plat/gpmc.h> | 46 | #include <plat/gpmc.h> |
47 | #include <plat/nand.h> | 47 | #include <plat/nand.h> |
48 | #include <plat/usb.h> | 48 | #include <plat/usb.h> |
@@ -189,33 +189,17 @@ static struct mtd_partition omap3beagle_nand_partitions[] = { | |||
189 | 189 | ||
190 | /* DSS */ | 190 | /* DSS */ |
191 | 191 | ||
192 | static int beagle_enable_dvi(struct omap_dss_device *dssdev) | 192 | static struct tfp410_platform_data dvi_panel = { |
193 | { | ||
194 | if (gpio_is_valid(dssdev->reset_gpio)) | ||
195 | gpio_set_value(dssdev->reset_gpio, 1); | ||
196 | |||
197 | return 0; | ||
198 | } | ||
199 | |||
200 | static 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 | |||
206 | static 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 | ||
212 | static struct omap_dss_device beagle_dvi_device = { | 197 | static struct omap_dss_device beagle_dvi_device = { |
213 | .type = OMAP_DISPLAY_TYPE_DPI, | 198 | .type = OMAP_DISPLAY_TYPE_DPI, |
214 | .name = "dvi", | 199 | .name = "dvi", |
215 | .driver_name = "dvi", | 200 | .driver_name = "tfp410", |
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 | ||
221 | static struct omap_dss_device beagle_tv_device = { | 205 | static 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 | ||
239 | static 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 | ||
251 | static struct omap2_hsmmc_info mmc[] = { | 225 | static 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..9919d6c1a531 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include "common.h" | 46 | #include "common.h" |
47 | #include <plat/mcspi.h> | 47 | #include <plat/mcspi.h> |
48 | #include <video/omapdss.h> | 48 | #include <video/omapdss.h> |
49 | #include <video/omap-panel-dvi.h> | 49 | #include <video/omap-panel-tfp410.h> |
50 | 50 | ||
51 | #include "mux.h" | 51 | #include "mux.h" |
52 | #include "sdram-micron-mt46h32m32lf-6.h" | 52 | #include "sdram-micron-mt46h32m32lf-6.h" |
@@ -219,35 +219,14 @@ 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 | ||
222 | static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev) | 222 | static struct tfp410_platform_data dvi_panel = { |
223 | { | 223 | .power_down_gpio = OMAP3EVM_DVI_PANEL_EN_GPIO, |
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 | |||
235 | static 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 | |||
242 | static struct panel_dvi_platform_data dvi_panel = { | ||
243 | .platform_enable = omap3_evm_enable_dvi, | ||
244 | .platform_disable = omap3_evm_disable_dvi, | ||
245 | }; | 224 | }; |
246 | 225 | ||
247 | static struct omap_dss_device omap3_evm_dvi_device = { | 226 | static struct omap_dss_device omap3_evm_dvi_device = { |
248 | .name = "dvi", | 227 | .name = "dvi", |
249 | .type = OMAP_DISPLAY_TYPE_DPI, | 228 | .type = OMAP_DISPLAY_TYPE_DPI, |
250 | .driver_name = "dvi", | 229 | .driver_name = "tfp410", |
251 | .data = &dvi_panel, | 230 | .data = &dvi_panel, |
252 | .phy.dpi.data_lines = 24, | 231 | .phy.dpi.data_lines = 24, |
253 | }; | 232 | }; |
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index 4dffc95bddd2..4396bae91677 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include <plat/usb.h> | 42 | #include <plat/usb.h> |
43 | #include <video/omapdss.h> | 43 | #include <video/omapdss.h> |
44 | #include <video/omap-panel-generic-dpi.h> | 44 | #include <video/omap-panel-generic-dpi.h> |
45 | #include <video/omap-panel-dvi.h> | 45 | #include <video/omap-panel-tfp410.h> |
46 | 46 | ||
47 | #include <plat/mcspi.h> | 47 | #include <plat/mcspi.h> |
48 | #include <linux/input/matrix_keypad.h> | 48 | #include <linux/input/matrix_keypad.h> |
@@ -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 | ||
95 | static int lcd_enabled; | ||
96 | static int dvi_enabled; | ||
97 | |||
98 | static void __init omap3_stalker_display_init(void) | 95 | static void __init omap3_stalker_display_init(void) |
99 | { | 96 | { |
100 | return; | 97 | return; |
@@ -122,32 +119,14 @@ 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 | ||
125 | static int omap3_stalker_enable_dvi(struct omap_dss_device *dssdev) | 122 | static struct tfp410_platform_data dvi_panel = { |
126 | { | 123 | .power_down_gpio = DSS_ENABLE_GPIO, |
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 | |||
136 | static 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 | |||
142 | static struct panel_dvi_platform_data dvi_panel = { | ||
143 | .platform_enable = omap3_stalker_enable_dvi, | ||
144 | .platform_disable = omap3_stalker_disable_dvi, | ||
145 | }; | 124 | }; |
146 | 125 | ||
147 | static struct omap_dss_device omap3_stalker_dvi_device = { | 126 | static struct omap_dss_device omap3_stalker_dvi_device = { |
148 | .name = "dvi", | 127 | .name = "dvi", |
149 | .type = OMAP_DISPLAY_TYPE_DPI, | 128 | .type = OMAP_DISPLAY_TYPE_DPI, |
150 | .driver_name = "dvi", | 129 | .driver_name = "tfp410", |
151 | .data = &dvi_panel, | 130 | .data = &dvi_panel, |
152 | .phy.dpi.data_lines = 24, | 131 | .phy.dpi.data_lines = 24, |
153 | }; | 132 | }; |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 1b782ba53433..b26cd15f3c8b 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include "common.h" | 42 | #include "common.h" |
43 | #include <plat/usb.h> | 43 | #include <plat/usb.h> |
44 | #include <plat/mmc.h> | 44 | #include <plat/mmc.h> |
45 | #include <video/omap-panel-dvi.h> | 45 | #include <video/omap-panel-tfp410.h> |
46 | 46 | ||
47 | #include "hsmmc.h" | 47 | #include "hsmmc.h" |
48 | #include "control.h" | 48 | #include "control.h" |
@@ -420,46 +420,22 @@ 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 | ||
423 | static int omap4_panda_enable_dvi(struct omap_dss_device *dssdev) | ||
424 | { | ||
425 | gpio_set_value(dssdev->reset_gpio, 1); | ||
426 | return 0; | ||
427 | } | ||
428 | |||
429 | static 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 */ |
435 | static struct panel_dvi_platform_data omap4_dvi_panel = { | 424 | static struct tfp410_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 | ||
441 | struct omap_dss_device omap4_panda_dvi_device = { | 429 | struct omap_dss_device omap4_panda_dvi_device = { |
442 | .type = OMAP_DISPLAY_TYPE_DPI, | 430 | .type = OMAP_DISPLAY_TYPE_DPI, |
443 | .name = "dvi", | 431 | .name = "dvi", |
444 | .driver_name = "dvi", | 432 | .driver_name = "tfp410", |
445 | .data = &omap4_dvi_panel, | 433 | .data = &omap4_dvi_panel, |
446 | .phy.dpi.data_lines = 24, | 434 | .phy.dpi.data_lines = 24, |
447 | .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO, | 435 | .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO, |
448 | .channel = OMAP_DSS_CHANNEL_LCD2, | 436 | .channel = OMAP_DSS_CHANNEL_LCD2, |
449 | }; | 437 | }; |
450 | 438 | ||
451 | int __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 | ||
464 | static struct gpio panda_hdmi_gpios[] = { | 440 | static 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 | ||
512 | void __init omap4_panda_display_init(void) | 488 | void __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..5527c1979a16 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include "common.h" | 46 | #include "common.h" |
47 | #include <video/omapdss.h> | 47 | #include <video/omapdss.h> |
48 | #include <video/omap-panel-generic-dpi.h> | 48 | #include <video/omap-panel-generic-dpi.h> |
49 | #include <video/omap-panel-dvi.h> | 49 | #include <video/omap-panel-tfp410.h> |
50 | #include <plat/gpmc.h> | 50 | #include <plat/gpmc.h> |
51 | #include <mach/hardware.h> | 51 | #include <mach/hardware.h> |
52 | #include <plat/nand.h> | 52 | #include <plat/nand.h> |
@@ -167,32 +167,15 @@ 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 | ||
170 | static int overo_panel_enable_dvi(struct omap_dss_device *dssdev) | 170 | static struct tfp410_platform_data dvi_panel = { |
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 | |||
181 | static void overo_panel_disable_dvi(struct omap_dss_device *dssdev) | ||
182 | { | ||
183 | dvi_enabled = 0; | ||
184 | } | ||
185 | |||
186 | static 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 | ||
192 | static struct omap_dss_device overo_dvi_device = { | 175 | static struct omap_dss_device overo_dvi_device = { |
193 | .name = "dvi", | 176 | .name = "dvi", |
194 | .type = OMAP_DISPLAY_TYPE_DPI, | 177 | .type = OMAP_DISPLAY_TYPE_DPI, |
195 | .driver_name = "dvi", | 178 | .driver_name = "tfp410", |
196 | .data = &dvi_panel, | 179 | .data = &dvi_panel, |
197 | .phy.dpi.data_lines = 24, | 180 | .phy.dpi.data_lines = 24, |
198 | }; | 181 | }; |
diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 408a9927be92..c3853c92279b 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig | |||
@@ -10,12 +10,12 @@ config PANEL_GENERIC_DPI | |||
10 | Supports LCD Panel used in TI SDP3430 and EVM boards, | 10 | Supports LCD Panel used in TI SDP3430 and EVM boards, |
11 | OMAP3517 EVM boards and CM-T35. | 11 | OMAP3517 EVM boards and CM-T35. |
12 | 12 | ||
13 | config PANEL_DVI | 13 | config PANEL_TFP410 |
14 | tristate "DVI output" | 14 | tristate "TFP410 DPI-to-DVI chip" |
15 | depends on OMAP2_DSS_DPI && I2C | 15 | depends on OMAP2_DSS_DPI && I2C |
16 | help | 16 | help |
17 | Driver for external monitors, connected via DVI. The driver uses i2c | 17 | Driver for TFP410 DPI-to-DVI chip. The driver uses i2c to read EDID |
18 | to read EDID information from the monitor. | 18 | information from the monitor. |
19 | 19 | ||
20 | config PANEL_LGPHILIPS_LB035Q02 | 20 | config PANEL_LGPHILIPS_LB035Q02 |
21 | tristate "LG.Philips LB035Q02 LCD Panel" | 21 | tristate "LG.Philips LB035Q02 LCD Panel" |
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index fbfafc6eebb4..58a5176b07b0 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o | 1 | obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o |
2 | obj-$(CONFIG_PANEL_DVI) += panel-dvi.o | 2 | obj-$(CONFIG_PANEL_TFP410) += panel-tfp410.o |
3 | obj-$(CONFIG_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o | 3 | obj-$(CONFIG_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o |
4 | obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o | 4 | obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o |
5 | obj-$(CONFIG_PANEL_NEC_NL8048HL11_01B) += panel-nec-nl8048hl11-01b.o | 5 | obj-$(CONFIG_PANEL_NEC_NL8048HL11_01B) += panel-nec-nl8048hl11-01b.o |
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 3053399faf9a..2ce9992f403b 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -912,6 +912,15 @@ static int taal_probe(struct omap_dss_device *dssdev) | |||
912 | 912 | ||
913 | dev_set_drvdata(&dssdev->dev, td); | 913 | dev_set_drvdata(&dssdev->dev, td); |
914 | 914 | ||
915 | if (gpio_is_valid(panel_data->reset_gpio)) { | ||
916 | r = gpio_request_one(panel_data->reset_gpio, GPIOF_OUT_INIT_LOW, | ||
917 | "taal rst"); | ||
918 | if (r) { | ||
919 | dev_err(&dssdev->dev, "failed to request reset gpio\n"); | ||
920 | goto err_rst_gpio; | ||
921 | } | ||
922 | } | ||
923 | |||
915 | taal_hw_reset(dssdev); | 924 | taal_hw_reset(dssdev); |
916 | 925 | ||
917 | if (panel_data->use_dsi_backlight) { | 926 | if (panel_data->use_dsi_backlight) { |
@@ -992,6 +1001,9 @@ err_gpio: | |||
992 | if (bldev != NULL) | 1001 | if (bldev != NULL) |
993 | backlight_device_unregister(bldev); | 1002 | backlight_device_unregister(bldev); |
994 | err_bl: | 1003 | err_bl: |
1004 | if (gpio_is_valid(panel_data->reset_gpio)) | ||
1005 | gpio_free(panel_data->reset_gpio); | ||
1006 | err_rst_gpio: | ||
995 | destroy_workqueue(td->workqueue); | 1007 | destroy_workqueue(td->workqueue); |
996 | err_wq: | 1008 | err_wq: |
997 | kfree(td); | 1009 | kfree(td); |
@@ -1030,15 +1042,25 @@ static void __exit taal_remove(struct omap_dss_device *dssdev) | |||
1030 | /* reset, to be sure that the panel is in a valid state */ | 1042 | /* reset, to be sure that the panel is in a valid state */ |
1031 | taal_hw_reset(dssdev); | 1043 | taal_hw_reset(dssdev); |
1032 | 1044 | ||
1045 | if (gpio_is_valid(panel_data->reset_gpio)) | ||
1046 | gpio_free(panel_data->reset_gpio); | ||
1047 | |||
1033 | kfree(td); | 1048 | kfree(td); |
1034 | } | 1049 | } |
1035 | 1050 | ||
1036 | static int taal_power_on(struct omap_dss_device *dssdev) | 1051 | static int taal_power_on(struct omap_dss_device *dssdev) |
1037 | { | 1052 | { |
1038 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); | 1053 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); |
1054 | struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev); | ||
1039 | u8 id1, id2, id3; | 1055 | u8 id1, id2, id3; |
1040 | int r; | 1056 | int r; |
1041 | 1057 | ||
1058 | r = omapdss_dsi_configure_pins(dssdev, &panel_data->pin_config); | ||
1059 | if (r) { | ||
1060 | dev_err(&dssdev->dev, "failed to configure DSI pins\n"); | ||
1061 | goto err0; | ||
1062 | }; | ||
1063 | |||
1042 | r = omapdss_dsi_display_enable(dssdev); | 1064 | r = omapdss_dsi_display_enable(dssdev); |
1043 | if (r) { | 1065 | if (r) { |
1044 | dev_err(&dssdev->dev, "failed to enable DSI\n"); | 1066 | dev_err(&dssdev->dev, "failed to enable DSI\n"); |
diff --git a/drivers/video/omap2/displays/panel-dvi.c b/drivers/video/omap2/displays/panel-tfp410.c index 03eb14af33e0..52637fa8fda8 100644 --- a/drivers/video/omap2/displays/panel-dvi.c +++ b/drivers/video/omap2/displays/panel-tfp410.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * DVI output support | 2 | * TFP410 DPI-to-DVI chip |
3 | * | 3 | * |
4 | * Copyright (C) 2011 Texas Instruments Inc | 4 | * Copyright (C) 2011 Texas Instruments Inc |
5 | * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> | 5 | * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> |
@@ -21,11 +21,12 @@ | |||
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | #include <video/omapdss.h> | 22 | #include <video/omapdss.h> |
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
24 | #include <linux/gpio.h> | ||
24 | #include <drm/drm_edid.h> | 25 | #include <drm/drm_edid.h> |
25 | 26 | ||
26 | #include <video/omap-panel-dvi.h> | 27 | #include <video/omap-panel-tfp410.h> |
27 | 28 | ||
28 | static const struct omap_video_timings panel_dvi_default_timings = { | 29 | static const struct omap_video_timings tfp410_default_timings = { |
29 | .x_res = 640, | 30 | .x_res = 640, |
30 | .y_res = 480, | 31 | .y_res = 480, |
31 | 32 | ||
@@ -44,17 +45,19 @@ struct panel_drv_data { | |||
44 | struct omap_dss_device *dssdev; | 45 | struct omap_dss_device *dssdev; |
45 | 46 | ||
46 | struct mutex lock; | 47 | struct mutex lock; |
48 | |||
49 | int pd_gpio; | ||
47 | }; | 50 | }; |
48 | 51 | ||
49 | static inline struct panel_dvi_platform_data | 52 | static inline struct tfp410_platform_data |
50 | *get_pdata(const struct omap_dss_device *dssdev) | 53 | *get_pdata(const struct omap_dss_device *dssdev) |
51 | { | 54 | { |
52 | return dssdev->data; | 55 | return dssdev->data; |
53 | } | 56 | } |
54 | 57 | ||
55 | static int panel_dvi_power_on(struct omap_dss_device *dssdev) | 58 | static int tfp410_power_on(struct omap_dss_device *dssdev) |
56 | { | 59 | { |
57 | struct panel_dvi_platform_data *pdata = get_pdata(dssdev); | 60 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
58 | int r; | 61 | int r; |
59 | 62 | ||
60 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | 63 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) |
@@ -64,57 +67,72 @@ static int panel_dvi_power_on(struct omap_dss_device *dssdev) | |||
64 | if (r) | 67 | if (r) |
65 | goto err0; | 68 | goto err0; |
66 | 69 | ||
67 | if (pdata->platform_enable) { | 70 | if (gpio_is_valid(ddata->pd_gpio)) |
68 | r = pdata->platform_enable(dssdev); | 71 | gpio_set_value(ddata->pd_gpio, 1); |
69 | if (r) | ||
70 | goto err1; | ||
71 | } | ||
72 | 72 | ||
73 | return 0; | 73 | return 0; |
74 | err1: | ||
75 | omapdss_dpi_display_disable(dssdev); | ||
76 | err0: | 74 | err0: |
77 | return r; | 75 | return r; |
78 | } | 76 | } |
79 | 77 | ||
80 | static void panel_dvi_power_off(struct omap_dss_device *dssdev) | 78 | static void tfp410_power_off(struct omap_dss_device *dssdev) |
81 | { | 79 | { |
82 | struct panel_dvi_platform_data *pdata = get_pdata(dssdev); | 80 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
83 | 81 | ||
84 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | 82 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) |
85 | return; | 83 | return; |
86 | 84 | ||
87 | if (pdata->platform_disable) | 85 | if (gpio_is_valid(ddata->pd_gpio)) |
88 | pdata->platform_disable(dssdev); | 86 | gpio_set_value(ddata->pd_gpio, 0); |
89 | 87 | ||
90 | omapdss_dpi_display_disable(dssdev); | 88 | omapdss_dpi_display_disable(dssdev); |
91 | } | 89 | } |
92 | 90 | ||
93 | static int panel_dvi_probe(struct omap_dss_device *dssdev) | 91 | static int tfp410_probe(struct omap_dss_device *dssdev) |
94 | { | 92 | { |
93 | struct tfp410_platform_data *pdata = get_pdata(dssdev); | ||
95 | struct panel_drv_data *ddata; | 94 | struct panel_drv_data *ddata; |
95 | int r; | ||
96 | 96 | ||
97 | ddata = kzalloc(sizeof(*ddata), GFP_KERNEL); | 97 | ddata = kzalloc(sizeof(*ddata), GFP_KERNEL); |
98 | if (!ddata) | 98 | if (!ddata) |
99 | return -ENOMEM; | 99 | return -ENOMEM; |
100 | 100 | ||
101 | dssdev->panel.timings = panel_dvi_default_timings; | 101 | dssdev->panel.timings = tfp410_default_timings; |
102 | dssdev->panel.config = OMAP_DSS_LCD_TFT; | 102 | dssdev->panel.config = OMAP_DSS_LCD_TFT; |
103 | 103 | ||
104 | ddata->dssdev = dssdev; | 104 | ddata->dssdev = dssdev; |
105 | mutex_init(&ddata->lock); | 105 | mutex_init(&ddata->lock); |
106 | 106 | ||
107 | if (pdata) | ||
108 | ddata->pd_gpio = pdata->power_down_gpio; | ||
109 | else | ||
110 | ddata->pd_gpio = -1; | ||
111 | |||
112 | if (gpio_is_valid(ddata->pd_gpio)) { | ||
113 | r = gpio_request_one(ddata->pd_gpio, GPIOF_OUT_INIT_LOW, | ||
114 | "tfp410 pd"); | ||
115 | if (r) { | ||
116 | dev_err(&dssdev->dev, "Failed to request PD GPIO %d\n", | ||
117 | ddata->pd_gpio); | ||
118 | ddata->pd_gpio = -1; | ||
119 | } | ||
120 | } | ||
121 | |||
107 | dev_set_drvdata(&dssdev->dev, ddata); | 122 | dev_set_drvdata(&dssdev->dev, ddata); |
108 | 123 | ||
109 | return 0; | 124 | return 0; |
110 | } | 125 | } |
111 | 126 | ||
112 | static void __exit panel_dvi_remove(struct omap_dss_device *dssdev) | 127 | static void __exit tfp410_remove(struct omap_dss_device *dssdev) |
113 | { | 128 | { |
114 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); | 129 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
115 | 130 | ||
116 | mutex_lock(&ddata->lock); | 131 | mutex_lock(&ddata->lock); |
117 | 132 | ||
133 | if (gpio_is_valid(ddata->pd_gpio)) | ||
134 | gpio_free(ddata->pd_gpio); | ||
135 | |||
118 | dev_set_drvdata(&dssdev->dev, NULL); | 136 | dev_set_drvdata(&dssdev->dev, NULL); |
119 | 137 | ||
120 | mutex_unlock(&ddata->lock); | 138 | mutex_unlock(&ddata->lock); |
@@ -122,14 +140,14 @@ static void __exit panel_dvi_remove(struct omap_dss_device *dssdev) | |||
122 | kfree(ddata); | 140 | kfree(ddata); |
123 | } | 141 | } |
124 | 142 | ||
125 | static int panel_dvi_enable(struct omap_dss_device *dssdev) | 143 | static int tfp410_enable(struct omap_dss_device *dssdev) |
126 | { | 144 | { |
127 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); | 145 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
128 | int r; | 146 | int r; |
129 | 147 | ||
130 | mutex_lock(&ddata->lock); | 148 | mutex_lock(&ddata->lock); |
131 | 149 | ||
132 | r = panel_dvi_power_on(dssdev); | 150 | r = tfp410_power_on(dssdev); |
133 | if (r == 0) | 151 | if (r == 0) |
134 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | 152 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; |
135 | 153 | ||
@@ -138,26 +156,26 @@ static int panel_dvi_enable(struct omap_dss_device *dssdev) | |||
138 | return r; | 156 | return r; |
139 | } | 157 | } |
140 | 158 | ||
141 | static void panel_dvi_disable(struct omap_dss_device *dssdev) | 159 | static void tfp410_disable(struct omap_dss_device *dssdev) |
142 | { | 160 | { |
143 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); | 161 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
144 | 162 | ||
145 | mutex_lock(&ddata->lock); | 163 | mutex_lock(&ddata->lock); |
146 | 164 | ||
147 | panel_dvi_power_off(dssdev); | 165 | tfp410_power_off(dssdev); |
148 | 166 | ||
149 | dssdev->state = OMAP_DSS_DISPLAY_DISABLED; | 167 | dssdev->state = OMAP_DSS_DISPLAY_DISABLED; |
150 | 168 | ||
151 | mutex_unlock(&ddata->lock); | 169 | mutex_unlock(&ddata->lock); |
152 | } | 170 | } |
153 | 171 | ||
154 | static int panel_dvi_suspend(struct omap_dss_device *dssdev) | 172 | static int tfp410_suspend(struct omap_dss_device *dssdev) |
155 | { | 173 | { |
156 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); | 174 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
157 | 175 | ||
158 | mutex_lock(&ddata->lock); | 176 | mutex_lock(&ddata->lock); |
159 | 177 | ||
160 | panel_dvi_power_off(dssdev); | 178 | tfp410_power_off(dssdev); |
161 | 179 | ||
162 | dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; | 180 | dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; |
163 | 181 | ||
@@ -166,14 +184,14 @@ static int panel_dvi_suspend(struct omap_dss_device *dssdev) | |||
166 | return 0; | 184 | return 0; |
167 | } | 185 | } |
168 | 186 | ||
169 | static int panel_dvi_resume(struct omap_dss_device *dssdev) | 187 | static int tfp410_resume(struct omap_dss_device *dssdev) |
170 | { | 188 | { |
171 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); | 189 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
172 | int r; | 190 | int r; |
173 | 191 | ||
174 | mutex_lock(&ddata->lock); | 192 | mutex_lock(&ddata->lock); |
175 | 193 | ||
176 | r = panel_dvi_power_on(dssdev); | 194 | r = tfp410_power_on(dssdev); |
177 | if (r == 0) | 195 | if (r == 0) |
178 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | 196 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; |
179 | 197 | ||
@@ -182,7 +200,7 @@ static int panel_dvi_resume(struct omap_dss_device *dssdev) | |||
182 | return r; | 200 | return r; |
183 | } | 201 | } |
184 | 202 | ||
185 | static void panel_dvi_set_timings(struct omap_dss_device *dssdev, | 203 | static void tfp410_set_timings(struct omap_dss_device *dssdev, |
186 | struct omap_video_timings *timings) | 204 | struct omap_video_timings *timings) |
187 | { | 205 | { |
188 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); | 206 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
@@ -192,7 +210,7 @@ static void panel_dvi_set_timings(struct omap_dss_device *dssdev, | |||
192 | mutex_unlock(&ddata->lock); | 210 | mutex_unlock(&ddata->lock); |
193 | } | 211 | } |
194 | 212 | ||
195 | static void panel_dvi_get_timings(struct omap_dss_device *dssdev, | 213 | static void tfp410_get_timings(struct omap_dss_device *dssdev, |
196 | struct omap_video_timings *timings) | 214 | struct omap_video_timings *timings) |
197 | { | 215 | { |
198 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); | 216 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
@@ -202,7 +220,7 @@ static void panel_dvi_get_timings(struct omap_dss_device *dssdev, | |||
202 | mutex_unlock(&ddata->lock); | 220 | mutex_unlock(&ddata->lock); |
203 | } | 221 | } |
204 | 222 | ||
205 | static int panel_dvi_check_timings(struct omap_dss_device *dssdev, | 223 | static int tfp410_check_timings(struct omap_dss_device *dssdev, |
206 | struct omap_video_timings *timings) | 224 | struct omap_video_timings *timings) |
207 | { | 225 | { |
208 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); | 226 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
@@ -216,7 +234,7 @@ static int panel_dvi_check_timings(struct omap_dss_device *dssdev, | |||
216 | } | 234 | } |
217 | 235 | ||
218 | 236 | ||
219 | static int panel_dvi_ddc_read(struct i2c_adapter *adapter, | 237 | static int tfp410_ddc_read(struct i2c_adapter *adapter, |
220 | unsigned char *buf, u16 count, u8 offset) | 238 | unsigned char *buf, u16 count, u8 offset) |
221 | { | 239 | { |
222 | int r, retries; | 240 | int r, retries; |
@@ -247,11 +265,11 @@ static int panel_dvi_ddc_read(struct i2c_adapter *adapter, | |||
247 | return r < 0 ? r : -EIO; | 265 | return r < 0 ? r : -EIO; |
248 | } | 266 | } |
249 | 267 | ||
250 | static int panel_dvi_read_edid(struct omap_dss_device *dssdev, | 268 | static int tfp410_read_edid(struct omap_dss_device *dssdev, |
251 | u8 *edid, int len) | 269 | u8 *edid, int len) |
252 | { | 270 | { |
253 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); | 271 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
254 | struct panel_dvi_platform_data *pdata = get_pdata(dssdev); | 272 | struct tfp410_platform_data *pdata = get_pdata(dssdev); |
255 | struct i2c_adapter *adapter; | 273 | struct i2c_adapter *adapter; |
256 | int r, l, bytes_read; | 274 | int r, l, bytes_read; |
257 | 275 | ||
@@ -271,7 +289,7 @@ static int panel_dvi_read_edid(struct omap_dss_device *dssdev, | |||
271 | } | 289 | } |
272 | 290 | ||
273 | l = min(EDID_LENGTH, len); | 291 | l = min(EDID_LENGTH, len); |
274 | r = panel_dvi_ddc_read(adapter, edid, l, 0); | 292 | r = tfp410_ddc_read(adapter, edid, l, 0); |
275 | if (r) | 293 | if (r) |
276 | goto err; | 294 | goto err; |
277 | 295 | ||
@@ -281,7 +299,7 @@ static int panel_dvi_read_edid(struct omap_dss_device *dssdev, | |||
281 | if (len > EDID_LENGTH && edid[0x7e] > 0) { | 299 | if (len > EDID_LENGTH && edid[0x7e] > 0) { |
282 | l = min(EDID_LENGTH, len - EDID_LENGTH); | 300 | l = min(EDID_LENGTH, len - EDID_LENGTH); |
283 | 301 | ||
284 | r = panel_dvi_ddc_read(adapter, edid + EDID_LENGTH, | 302 | r = tfp410_ddc_read(adapter, edid + EDID_LENGTH, |
285 | l, EDID_LENGTH); | 303 | l, EDID_LENGTH); |
286 | if (r) | 304 | if (r) |
287 | goto err; | 305 | goto err; |
@@ -298,10 +316,10 @@ err: | |||
298 | return r; | 316 | return r; |
299 | } | 317 | } |
300 | 318 | ||
301 | static bool panel_dvi_detect(struct omap_dss_device *dssdev) | 319 | static bool tfp410_detect(struct omap_dss_device *dssdev) |
302 | { | 320 | { |
303 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); | 321 | struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); |
304 | struct panel_dvi_platform_data *pdata = get_pdata(dssdev); | 322 | struct tfp410_platform_data *pdata = get_pdata(dssdev); |
305 | struct i2c_adapter *adapter; | 323 | struct i2c_adapter *adapter; |
306 | unsigned char out; | 324 | unsigned char out; |
307 | int r; | 325 | int r; |
@@ -315,7 +333,7 @@ static bool panel_dvi_detect(struct omap_dss_device *dssdev) | |||
315 | if (!adapter) | 333 | if (!adapter) |
316 | goto out; | 334 | goto out; |
317 | 335 | ||
318 | r = panel_dvi_ddc_read(adapter, &out, 1, 0); | 336 | r = tfp410_ddc_read(adapter, &out, 1, 0); |
319 | 337 | ||
320 | mutex_unlock(&ddata->lock); | 338 | mutex_unlock(&ddata->lock); |
321 | 339 | ||
@@ -326,38 +344,38 @@ out: | |||
326 | return true; | 344 | return true; |
327 | } | 345 | } |
328 | 346 | ||
329 | static struct omap_dss_driver panel_dvi_driver = { | 347 | static struct omap_dss_driver tfp410_driver = { |
330 | .probe = panel_dvi_probe, | 348 | .probe = tfp410_probe, |
331 | .remove = __exit_p(panel_dvi_remove), | 349 | .remove = __exit_p(tfp410_remove), |
332 | 350 | ||
333 | .enable = panel_dvi_enable, | 351 | .enable = tfp410_enable, |
334 | .disable = panel_dvi_disable, | 352 | .disable = tfp410_disable, |
335 | .suspend = panel_dvi_suspend, | 353 | .suspend = tfp410_suspend, |
336 | .resume = panel_dvi_resume, | 354 | .resume = tfp410_resume, |
337 | 355 | ||
338 | .set_timings = panel_dvi_set_timings, | 356 | .set_timings = tfp410_set_timings, |
339 | .get_timings = panel_dvi_get_timings, | 357 | .get_timings = tfp410_get_timings, |
340 | .check_timings = panel_dvi_check_timings, | 358 | .check_timings = tfp410_check_timings, |
341 | 359 | ||
342 | .read_edid = panel_dvi_read_edid, | 360 | .read_edid = tfp410_read_edid, |
343 | .detect = panel_dvi_detect, | 361 | .detect = tfp410_detect, |
344 | 362 | ||
345 | .driver = { | 363 | .driver = { |
346 | .name = "dvi", | 364 | .name = "tfp410", |
347 | .owner = THIS_MODULE, | 365 | .owner = THIS_MODULE, |
348 | }, | 366 | }, |
349 | }; | 367 | }; |
350 | 368 | ||
351 | static int __init panel_dvi_init(void) | 369 | static int __init tfp410_init(void) |
352 | { | 370 | { |
353 | return omap_dss_register_driver(&panel_dvi_driver); | 371 | return omap_dss_register_driver(&tfp410_driver); |
354 | } | 372 | } |
355 | 373 | ||
356 | static void __exit panel_dvi_exit(void) | 374 | static void __exit tfp410_exit(void) |
357 | { | 375 | { |
358 | omap_dss_unregister_driver(&panel_dvi_driver); | 376 | omap_dss_unregister_driver(&tfp410_driver); |
359 | } | 377 | } |
360 | 378 | ||
361 | module_init(panel_dvi_init); | 379 | module_init(tfp410_init); |
362 | module_exit(panel_dvi_exit); | 380 | module_exit(tfp410_exit); |
363 | MODULE_LICENSE("GPL"); | 381 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 95bc9964ab9c..446e13667471 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -2045,65 +2045,6 @@ static unsigned dsi_get_line_buf_size(struct platform_device *dsidev) | |||
2045 | } | 2045 | } |
2046 | } | 2046 | } |
2047 | 2047 | ||
2048 | static int dsi_parse_lane_config(struct omap_dss_device *dssdev) | ||
2049 | { | ||
2050 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
2051 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | ||
2052 | u8 lanes[DSI_MAX_NR_LANES]; | ||
2053 | u8 polarities[DSI_MAX_NR_LANES]; | ||
2054 | int num_lanes, i; | ||
2055 | |||
2056 | static const enum dsi_lane_function functions[] = { | ||
2057 | DSI_LANE_CLK, | ||
2058 | DSI_LANE_DATA1, | ||
2059 | DSI_LANE_DATA2, | ||
2060 | DSI_LANE_DATA3, | ||
2061 | DSI_LANE_DATA4, | ||
2062 | }; | ||
2063 | |||
2064 | lanes[0] = dssdev->phy.dsi.clk_lane; | ||
2065 | lanes[1] = dssdev->phy.dsi.data1_lane; | ||
2066 | lanes[2] = dssdev->phy.dsi.data2_lane; | ||
2067 | lanes[3] = dssdev->phy.dsi.data3_lane; | ||
2068 | lanes[4] = dssdev->phy.dsi.data4_lane; | ||
2069 | polarities[0] = dssdev->phy.dsi.clk_pol; | ||
2070 | polarities[1] = dssdev->phy.dsi.data1_pol; | ||
2071 | polarities[2] = dssdev->phy.dsi.data2_pol; | ||
2072 | polarities[3] = dssdev->phy.dsi.data3_pol; | ||
2073 | polarities[4] = dssdev->phy.dsi.data4_pol; | ||
2074 | |||
2075 | num_lanes = 0; | ||
2076 | |||
2077 | for (i = 0; i < dsi->num_lanes_supported; ++i) | ||
2078 | dsi->lanes[i].function = DSI_LANE_UNUSED; | ||
2079 | |||
2080 | for (i = 0; i < dsi->num_lanes_supported; ++i) { | ||
2081 | int num; | ||
2082 | |||
2083 | if (lanes[i] == DSI_LANE_UNUSED) | ||
2084 | break; | ||
2085 | |||
2086 | num = lanes[i] - 1; | ||
2087 | |||
2088 | if (num >= dsi->num_lanes_supported) | ||
2089 | return -EINVAL; | ||
2090 | |||
2091 | if (dsi->lanes[num].function != DSI_LANE_UNUSED) | ||
2092 | return -EINVAL; | ||
2093 | |||
2094 | dsi->lanes[num].function = functions[i]; | ||
2095 | dsi->lanes[num].polarity = polarities[i]; | ||
2096 | num_lanes++; | ||
2097 | } | ||
2098 | |||
2099 | if (num_lanes < 2 || num_lanes > dsi->num_lanes_supported) | ||
2100 | return -EINVAL; | ||
2101 | |||
2102 | dsi->num_lanes_used = num_lanes; | ||
2103 | |||
2104 | return 0; | ||
2105 | } | ||
2106 | |||
2107 | static int dsi_set_lane_config(struct omap_dss_device *dssdev) | 2048 | static int dsi_set_lane_config(struct omap_dss_device *dssdev) |
2108 | { | 2049 | { |
2109 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 2050 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
@@ -3944,6 +3885,74 @@ static void dsi_proto_timings(struct omap_dss_device *dssdev) | |||
3944 | } | 3885 | } |
3945 | } | 3886 | } |
3946 | 3887 | ||
3888 | int omapdss_dsi_configure_pins(struct omap_dss_device *dssdev, | ||
3889 | const struct omap_dsi_pin_config *pin_cfg) | ||
3890 | { | ||
3891 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
3892 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | ||
3893 | int num_pins; | ||
3894 | const int *pins; | ||
3895 | struct dsi_lane_config lanes[DSI_MAX_NR_LANES]; | ||
3896 | int num_lanes; | ||
3897 | int i; | ||
3898 | |||
3899 | static const enum dsi_lane_function functions[] = { | ||
3900 | DSI_LANE_CLK, | ||
3901 | DSI_LANE_DATA1, | ||
3902 | DSI_LANE_DATA2, | ||
3903 | DSI_LANE_DATA3, | ||
3904 | DSI_LANE_DATA4, | ||
3905 | }; | ||
3906 | |||
3907 | num_pins = pin_cfg->num_pins; | ||
3908 | pins = pin_cfg->pins; | ||
3909 | |||
3910 | if (num_pins < 4 || num_pins > dsi->num_lanes_supported * 2 | ||
3911 | || num_pins % 2 != 0) | ||
3912 | return -EINVAL; | ||
3913 | |||
3914 | for (i = 0; i < DSI_MAX_NR_LANES; ++i) | ||
3915 | lanes[i].function = DSI_LANE_UNUSED; | ||
3916 | |||
3917 | num_lanes = 0; | ||
3918 | |||
3919 | for (i = 0; i < num_pins; i += 2) { | ||
3920 | u8 lane, pol; | ||
3921 | int dx, dy; | ||
3922 | |||
3923 | dx = pins[i]; | ||
3924 | dy = pins[i + 1]; | ||
3925 | |||
3926 | if (dx < 0 || dx >= dsi->num_lanes_supported * 2) | ||
3927 | return -EINVAL; | ||
3928 | |||
3929 | if (dy < 0 || dy >= dsi->num_lanes_supported * 2) | ||
3930 | return -EINVAL; | ||
3931 | |||
3932 | if (dx & 1) { | ||
3933 | if (dy != dx - 1) | ||
3934 | return -EINVAL; | ||
3935 | pol = 1; | ||
3936 | } else { | ||
3937 | if (dy != dx + 1) | ||
3938 | return -EINVAL; | ||
3939 | pol = 0; | ||
3940 | } | ||
3941 | |||
3942 | lane = dx / 2; | ||
3943 | |||
3944 | lanes[lane].function = functions[i / 2]; | ||
3945 | lanes[lane].polarity = pol; | ||
3946 | num_lanes++; | ||
3947 | } | ||
3948 | |||
3949 | memcpy(dsi->lanes, lanes, sizeof(dsi->lanes)); | ||
3950 | dsi->num_lanes_used = num_lanes; | ||
3951 | |||
3952 | return 0; | ||
3953 | } | ||
3954 | EXPORT_SYMBOL(omapdss_dsi_configure_pins); | ||
3955 | |||
3947 | int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) | 3956 | int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) |
3948 | { | 3957 | { |
3949 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 3958 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
@@ -4301,12 +4310,6 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev) | |||
4301 | int dsi_module = dsi_get_dsidev_id(dsidev); | 4310 | int dsi_module = dsi_get_dsidev_id(dsidev); |
4302 | int r; | 4311 | int r; |
4303 | 4312 | ||
4304 | r = dsi_parse_lane_config(dssdev); | ||
4305 | if (r) { | ||
4306 | DSSERR("illegal lane config"); | ||
4307 | goto err0; | ||
4308 | } | ||
4309 | |||
4310 | r = dsi_pll_init(dsidev, true, true); | 4313 | r = dsi_pll_init(dsidev, true, true); |
4311 | if (r) | 4314 | if (r) |
4312 | goto err0; | 4315 | goto err0; |
diff --git a/include/video/omap-panel-nokia-dsi.h b/include/video/omap-panel-nokia-dsi.h index 7dc71f9c13e6..04219a295539 100644 --- a/include/video/omap-panel-nokia-dsi.h +++ b/include/video/omap-panel-nokia-dsi.h | |||
@@ -11,6 +11,7 @@ struct omap_dss_device; | |||
11 | * @esd_interval: interval of ESD checks, 0 = disabled (ms) | 11 | * @esd_interval: interval of ESD checks, 0 = disabled (ms) |
12 | * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms) | 12 | * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms) |
13 | * @use_dsi_backlight: true if panel uses DSI command to control backlight | 13 | * @use_dsi_backlight: true if panel uses DSI command to control backlight |
14 | * @pin_config: DSI pin configuration | ||
14 | */ | 15 | */ |
15 | struct nokia_dsi_panel_data { | 16 | struct nokia_dsi_panel_data { |
16 | const char *name; | 17 | const char *name; |
@@ -24,6 +25,8 @@ struct nokia_dsi_panel_data { | |||
24 | unsigned ulps_timeout; | 25 | unsigned ulps_timeout; |
25 | 26 | ||
26 | bool use_dsi_backlight; | 27 | bool use_dsi_backlight; |
28 | |||
29 | struct omap_dsi_pin_config pin_config; | ||
27 | }; | 30 | }; |
28 | 31 | ||
29 | #endif /* __OMAP_NOKIA_DSI_PANEL_H */ | 32 | #endif /* __OMAP_NOKIA_DSI_PANEL_H */ |
diff --git a/include/video/omap-panel-dvi.h b/include/video/omap-panel-tfp410.h index 87ad567b4229..68c31d79c571 100644 --- a/include/video/omap-panel-dvi.h +++ b/include/video/omap-panel-tfp410.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Header for DVI output driver | 2 | * Header for TFP410 chip driver |
3 | * | 3 | * |
4 | * Copyright (C) 2011 Texas Instruments Inc | 4 | * Copyright (C) 2011 Texas Instruments Inc |
5 | * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> | 5 | * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> |
@@ -17,21 +17,19 @@ | |||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * this program. If not, see <http://www.gnu.org/licenses/>. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef __OMAP_PANEL_DVI_H | 20 | #ifndef __OMAP_PANEL_TFP410_H |
21 | #define __OMAP_PANEL_DVI_H | 21 | #define __OMAP_PANEL_TFP410_H |
22 | 22 | ||
23 | struct omap_dss_device; | 23 | struct omap_dss_device; |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * struct panel_dvi_platform_data - panel driver configuration data | 26 | * struct tfp410_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 |
28 | * @power_down_gpio: gpio number for PD pin (or -1 if not available) | ||
30 | */ | 29 | */ |
31 | struct panel_dvi_platform_data { | 30 | struct tfp410_platform_data { |
32 | int (*platform_enable)(struct omap_dss_device *dssdev); | ||
33 | void (*platform_disable)(struct omap_dss_device *dssdev); | ||
34 | u16 i2c_bus_num; | 31 | u16 i2c_bus_num; |
32 | int power_down_gpio; | ||
35 | }; | 33 | }; |
36 | 34 | ||
37 | #endif /* __OMAP_PANEL_DVI_H */ | 35 | #endif /* __OMAP_PANEL_TFP410_H */ |
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 5f36ddd0e295..1cbb2dd5fbba 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -469,6 +469,21 @@ struct omap_overlay_manager { | |||
469 | int (*wait_for_vsync)(struct omap_overlay_manager *mgr); | 469 | int (*wait_for_vsync)(struct omap_overlay_manager *mgr); |
470 | }; | 470 | }; |
471 | 471 | ||
472 | /* 22 pins means 1 clk lane and 10 data lanes */ | ||
473 | #define OMAP_DSS_MAX_DSI_PINS 22 | ||
474 | |||
475 | struct omap_dsi_pin_config { | ||
476 | int num_pins; | ||
477 | /* | ||
478 | * pin numbers in the following order: | ||
479 | * clk+, clk- | ||
480 | * data1+, data1- | ||
481 | * data2+, data2- | ||
482 | * ... | ||
483 | */ | ||
484 | int pins[OMAP_DSS_MAX_DSI_PINS]; | ||
485 | }; | ||
486 | |||
472 | struct omap_dss_device { | 487 | struct omap_dss_device { |
473 | struct device dev; | 488 | struct device dev; |
474 | 489 | ||
@@ -491,17 +506,6 @@ struct omap_dss_device { | |||
491 | } sdi; | 506 | } sdi; |
492 | 507 | ||
493 | struct { | 508 | struct { |
494 | u8 clk_lane; | ||
495 | u8 clk_pol; | ||
496 | u8 data1_lane; | ||
497 | u8 data1_pol; | ||
498 | u8 data2_lane; | ||
499 | u8 data2_pol; | ||
500 | u8 data3_lane; | ||
501 | u8 data3_pol; | ||
502 | u8 data4_lane; | ||
503 | u8 data4_pol; | ||
504 | |||
505 | int module; | 509 | int module; |
506 | 510 | ||
507 | bool ext_te; | 511 | bool ext_te; |
@@ -690,6 +694,8 @@ int omap_dsi_update(struct omap_dss_device *dssdev, int channel, | |||
690 | int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel); | 694 | int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel); |
691 | int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id); | 695 | int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id); |
692 | void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel); | 696 | void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel); |
697 | int omapdss_dsi_configure_pins(struct omap_dss_device *dssdev, | ||
698 | const struct omap_dsi_pin_config *pin_cfg); | ||
693 | 699 | ||
694 | int omapdss_dsi_display_enable(struct omap_dss_device *dssdev); | 700 | int omapdss_dsi_display_enable(struct omap_dss_device *dssdev); |
695 | void omapdss_dsi_display_disable(struct omap_dss_device *dssdev, | 701 | void omapdss_dsi_display_disable(struct omap_dss_device *dssdev, |