Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[deliverable/linux.git] / arch / arm / mach-omap2 / dss-common.c
1 /*
2 * Copyright (C) 2012 Texas Instruments, Inc..
3 * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17 * 02110-1301 USA
18 *
19 */
20
21 /*
22 * NOTE: this is a transitional file to help with DT adaptation.
23 * This file will be removed when DSS supports DT.
24 */
25
26 #include <linux/kernel.h>
27 #include <linux/gpio.h>
28 #include <linux/platform_device.h>
29
30 #include <video/omapdss.h>
31 #include <video/omap-panel-data.h>
32
33 #include "soc.h"
34 #include "dss-common.h"
35 #include "mux.h"
36
37 #define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
38 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
39 #define HDMI_GPIO_HPD 63 /* Hotplug detect */
40
41 #define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
42
43 /* DVI Connector */
44 static struct connector_dvi_platform_data omap4_panda_dvi_connector_pdata = {
45 .name = "dvi",
46 .source = "tfp410.0",
47 .i2c_bus_num = 2,
48 };
49
50 static struct platform_device omap4_panda_dvi_connector_device = {
51 .name = "connector-dvi",
52 .id = 0,
53 .dev.platform_data = &omap4_panda_dvi_connector_pdata,
54 };
55
56 /* TFP410 DPI-to-DVI chip */
57 static struct encoder_tfp410_platform_data omap4_panda_tfp410_pdata = {
58 .name = "tfp410.0",
59 .source = "dpi.0",
60 .data_lines = 24,
61 .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
62 };
63
64 static struct platform_device omap4_panda_tfp410_device = {
65 .name = "tfp410",
66 .id = 0,
67 .dev.platform_data = &omap4_panda_tfp410_pdata,
68 };
69
70 /* HDMI Connector */
71 static struct connector_hdmi_platform_data omap4_panda_hdmi_connector_pdata = {
72 .name = "hdmi",
73 .source = "tpd12s015.0",
74 };
75
76 static struct platform_device omap4_panda_hdmi_connector_device = {
77 .name = "connector-hdmi",
78 .id = 0,
79 .dev.platform_data = &omap4_panda_hdmi_connector_pdata,
80 };
81
82 /* TPD12S015 HDMI ESD protection & level shifter chip */
83 static struct encoder_tpd12s015_platform_data omap4_panda_tpd_pdata = {
84 .name = "tpd12s015.0",
85 .source = "hdmi.0",
86
87 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
88 .ls_oe_gpio = HDMI_GPIO_LS_OE,
89 .hpd_gpio = HDMI_GPIO_HPD,
90 };
91
92 static struct platform_device omap4_panda_tpd_device = {
93 .name = "tpd12s015",
94 .id = 0,
95 .dev.platform_data = &omap4_panda_tpd_pdata,
96 };
97
98 static struct omap_dss_board_info omap4_panda_dss_data = {
99 .default_display_name = "dvi",
100 };
101
102 void __init omap4_panda_display_init_of(void)
103 {
104 omap_display_init(&omap4_panda_dss_data);
105
106 platform_device_register(&omap4_panda_tfp410_device);
107 platform_device_register(&omap4_panda_dvi_connector_device);
108
109 platform_device_register(&omap4_panda_tpd_device);
110 platform_device_register(&omap4_panda_hdmi_connector_device);
111 }
112
113
114 /* OMAP4 Blaze display data */
115
116 #define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
117 #define DLP_POWER_ON_GPIO 40
118
119 static struct panel_dsicm_platform_data dsi1_panel = {
120 .name = "lcd",
121 .source = "dsi.0",
122 .reset_gpio = 102,
123 .use_ext_te = false,
124 .ext_te_gpio = 101,
125 .pin_config = {
126 .num_pins = 6,
127 .pins = { 0, 1, 2, 3, 4, 5 },
128 },
129 };
130
131 static struct platform_device sdp4430_lcd_device = {
132 .name = "panel-dsi-cm",
133 .id = 0,
134 .dev.platform_data = &dsi1_panel,
135 };
136
137 static struct panel_dsicm_platform_data dsi2_panel = {
138 .name = "lcd2",
139 .source = "dsi.1",
140 .reset_gpio = 104,
141 .use_ext_te = false,
142 .ext_te_gpio = 103,
143 .pin_config = {
144 .num_pins = 6,
145 .pins = { 0, 1, 2, 3, 4, 5 },
146 },
147 };
148
149 static struct platform_device sdp4430_lcd2_device = {
150 .name = "panel-dsi-cm",
151 .id = 1,
152 .dev.platform_data = &dsi2_panel,
153 };
154
155 /* HDMI Connector */
156 static struct connector_hdmi_platform_data sdp4430_hdmi_connector_pdata = {
157 .name = "hdmi",
158 .source = "tpd12s015.0",
159 };
160
161 static struct platform_device sdp4430_hdmi_connector_device = {
162 .name = "connector-hdmi",
163 .id = 0,
164 .dev.platform_data = &sdp4430_hdmi_connector_pdata,
165 };
166
167 /* TPD12S015 HDMI ESD protection & level shifter chip */
168 static struct encoder_tpd12s015_platform_data sdp4430_tpd_pdata = {
169 .name = "tpd12s015.0",
170 .source = "hdmi.0",
171
172 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
173 .ls_oe_gpio = HDMI_GPIO_LS_OE,
174 .hpd_gpio = HDMI_GPIO_HPD,
175 };
176
177 static struct platform_device sdp4430_tpd_device = {
178 .name = "tpd12s015",
179 .id = 0,
180 .dev.platform_data = &sdp4430_tpd_pdata,
181 };
182
183
184 static struct omap_dss_board_info sdp4430_dss_data = {
185 .default_display_name = "lcd",
186 };
187
188 /*
189 * we select LCD2 by default (instead of Pico DLP) by setting DISPLAY_SEL_GPIO.
190 * Setting DLP_POWER_ON gpio enables the VDLP_2V5 VDLP_1V8 and VDLP_1V0 rails
191 * used by picodlp on the 4430sdp platform. Keep this gpio disabled as LCD2 is
192 * selected by default
193 */
194 void __init omap_4430sdp_display_init_of(void)
195 {
196 int r;
197
198 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
199 "display_sel");
200 if (r)
201 pr_err("%s: Could not get display_sel GPIO\n", __func__);
202
203 r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
204 "DLP POWER ON");
205 if (r)
206 pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
207
208 omap_display_init(&sdp4430_dss_data);
209
210 platform_device_register(&sdp4430_lcd_device);
211 platform_device_register(&sdp4430_lcd2_device);
212
213 platform_device_register(&sdp4430_tpd_device);
214 platform_device_register(&sdp4430_hdmi_connector_device);
215 }
216
217
218 /* OMAP3 IGEPv2 data */
219
220 #define IGEP2_DVI_TFP410_POWER_DOWN_GPIO 170
221
222 /* DVI Connector */
223 static struct connector_dvi_platform_data omap3_igep2_dvi_connector_pdata = {
224 .name = "dvi",
225 .source = "tfp410.0",
226 .i2c_bus_num = 3,
227 };
228
229 static struct platform_device omap3_igep2_dvi_connector_device = {
230 .name = "connector-dvi",
231 .id = 0,
232 .dev.platform_data = &omap3_igep2_dvi_connector_pdata,
233 };
234
235 /* TFP410 DPI-to-DVI chip */
236 static struct encoder_tfp410_platform_data omap3_igep2_tfp410_pdata = {
237 .name = "tfp410.0",
238 .source = "dpi.0",
239 .data_lines = 24,
240 .power_down_gpio = IGEP2_DVI_TFP410_POWER_DOWN_GPIO,
241 };
242
243 static struct platform_device omap3_igep2_tfp410_device = {
244 .name = "tfp410",
245 .id = 0,
246 .dev.platform_data = &omap3_igep2_tfp410_pdata,
247 };
248
249 static struct omap_dss_board_info igep2_dss_data = {
250 .default_display_name = "dvi",
251 };
252
253 void __init omap3_igep2_display_init_of(void)
254 {
255 omap_display_init(&igep2_dss_data);
256
257 platform_device_register(&omap3_igep2_tfp410_device);
258 platform_device_register(&omap3_igep2_dvi_connector_device);
259 }
This page took 0.055116 seconds and 6 git commands to generate.