2 * Copyright (C) 2012 Texas Instruments, Inc..
3 * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
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.
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.
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
22 * NOTE: this is a transitional file to help with DT adaptation.
23 * This file will be removed when DSS supports DT.
26 #include <linux/kernel.h>
27 #include <linux/gpio.h>
29 #include <video/omapdss.h>
30 #include <video/omap-panel-tfp410.h>
31 #include <video/omap-panel-nokia-dsi.h>
32 #include <video/omap-panel-picodlp.h>
36 #include "dss-common.h"
39 #define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
40 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
41 #define HDMI_GPIO_HPD 63 /* Hotplug detect */
44 #define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
46 /* Using generic display panel */
47 static struct tfp410_platform_data omap4_dvi_panel
= {
49 .power_down_gpio
= PANDA_DVI_TFP410_POWER_DOWN_GPIO
,
52 static struct omap_dss_device omap4_panda_dvi_device
= {
53 .type
= OMAP_DISPLAY_TYPE_DPI
,
55 .driver_name
= "tfp410",
56 .data
= &omap4_dvi_panel
,
57 .phy
.dpi
.data_lines
= 24,
58 .reset_gpio
= PANDA_DVI_TFP410_POWER_DOWN_GPIO
,
59 .channel
= OMAP_DSS_CHANNEL_LCD2
,
62 static struct omap_dss_hdmi_data omap4_panda_hdmi_data
= {
63 .ct_cp_hpd_gpio
= HDMI_GPIO_CT_CP_HPD
,
64 .ls_oe_gpio
= HDMI_GPIO_LS_OE
,
65 .hpd_gpio
= HDMI_GPIO_HPD
,
68 static struct omap_dss_device omap4_panda_hdmi_device
= {
70 .driver_name
= "hdmi_panel",
71 .type
= OMAP_DISPLAY_TYPE_HDMI
,
72 .channel
= OMAP_DSS_CHANNEL_DIGIT
,
73 .data
= &omap4_panda_hdmi_data
,
76 static struct omap_dss_device
*omap4_panda_dss_devices
[] = {
77 &omap4_panda_dvi_device
,
78 &omap4_panda_hdmi_device
,
81 static struct omap_dss_board_info omap4_panda_dss_data
= {
82 .num_devices
= ARRAY_SIZE(omap4_panda_dss_devices
),
83 .devices
= omap4_panda_dss_devices
,
84 .default_device
= &omap4_panda_dvi_device
,
87 void __init
omap4_panda_display_init(void)
89 omap_display_init(&omap4_panda_dss_data
);
92 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
93 * later have external pull up on the HDMI I2C lines
95 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2
)
96 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP
);
100 omap_mux_init_gpio(HDMI_GPIO_LS_OE
, OMAP_PIN_OUTPUT
);
101 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD
, OMAP_PIN_OUTPUT
);
102 omap_mux_init_gpio(HDMI_GPIO_HPD
, OMAP_PIN_INPUT_PULLDOWN
);
105 void __init
omap4_panda_display_init_of(void)
107 omap_display_init(&omap4_panda_dss_data
);
111 /* OMAP4 Blaze display data */
113 #define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
114 #define DLP_POWER_ON_GPIO 40
116 static struct nokia_dsi_panel_data dsi1_panel
= {
124 .pins
= { 0, 1, 2, 3, 4, 5 },
128 static struct omap_dss_device sdp4430_lcd_device
= {
130 .driver_name
= "taal",
131 .type
= OMAP_DISPLAY_TYPE_DSI
,
136 .channel
= OMAP_DSS_CHANNEL_LCD
,
139 static struct nokia_dsi_panel_data dsi2_panel
= {
147 .pins
= { 0, 1, 2, 3, 4, 5 },
151 static struct omap_dss_device sdp4430_lcd2_device
= {
153 .driver_name
= "taal",
154 .type
= OMAP_DISPLAY_TYPE_DSI
,
160 .channel
= OMAP_DSS_CHANNEL_LCD2
,
163 static struct omap_dss_hdmi_data sdp4430_hdmi_data
= {
164 .ct_cp_hpd_gpio
= HDMI_GPIO_CT_CP_HPD
,
165 .ls_oe_gpio
= HDMI_GPIO_LS_OE
,
166 .hpd_gpio
= HDMI_GPIO_HPD
,
169 static struct omap_dss_device sdp4430_hdmi_device
= {
171 .driver_name
= "hdmi_panel",
172 .type
= OMAP_DISPLAY_TYPE_HDMI
,
173 .channel
= OMAP_DSS_CHANNEL_DIGIT
,
174 .data
= &sdp4430_hdmi_data
,
177 static struct picodlp_panel_data sdp4430_picodlp_pdata
= {
178 .picodlp_adapter_id
= 2,
183 static void sdp4430_picodlp_init(void)
186 const struct gpio picodlp_gpios
[] = {
187 {DLP_POWER_ON_GPIO
, GPIOF_OUT_INIT_LOW
,
189 {sdp4430_picodlp_pdata
.emu_done_gpio
, GPIOF_IN
,
191 {sdp4430_picodlp_pdata
.pwrgood_gpio
, GPIOF_OUT_INIT_LOW
,
195 r
= gpio_request_array(picodlp_gpios
, ARRAY_SIZE(picodlp_gpios
));
197 pr_err("Cannot request PicoDLP GPIOs, error %d\n", r
);
200 static int sdp4430_panel_enable_picodlp(struct omap_dss_device
*dssdev
)
202 gpio_set_value(DISPLAY_SEL_GPIO
, 0);
203 gpio_set_value(DLP_POWER_ON_GPIO
, 1);
208 static void sdp4430_panel_disable_picodlp(struct omap_dss_device
*dssdev
)
210 gpio_set_value(DLP_POWER_ON_GPIO
, 0);
211 gpio_set_value(DISPLAY_SEL_GPIO
, 1);
214 static struct omap_dss_device sdp4430_picodlp_device
= {
216 .driver_name
= "picodlp_panel",
217 .type
= OMAP_DISPLAY_TYPE_DPI
,
218 .phy
.dpi
.data_lines
= 24,
219 .channel
= OMAP_DSS_CHANNEL_LCD2
,
220 .platform_enable
= sdp4430_panel_enable_picodlp
,
221 .platform_disable
= sdp4430_panel_disable_picodlp
,
222 .data
= &sdp4430_picodlp_pdata
,
225 static struct omap_dss_device
*sdp4430_dss_devices
[] = {
227 &sdp4430_lcd2_device
,
228 &sdp4430_hdmi_device
,
229 &sdp4430_picodlp_device
,
232 static struct omap_dss_board_info sdp4430_dss_data
= {
233 .num_devices
= ARRAY_SIZE(sdp4430_dss_devices
),
234 .devices
= sdp4430_dss_devices
,
235 .default_device
= &sdp4430_lcd_device
,
238 void __init
omap_4430sdp_display_init(void)
242 /* Enable LCD2 by default (instead of Pico DLP) */
243 r
= gpio_request_one(DISPLAY_SEL_GPIO
, GPIOF_OUT_INIT_HIGH
,
246 pr_err("%s: Could not get display_sel GPIO\n", __func__
);
248 sdp4430_picodlp_init();
249 omap_display_init(&sdp4430_dss_data
);
251 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
252 * later have external pull up on the HDMI I2C lines
254 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2
)
255 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP
);
259 omap_mux_init_gpio(HDMI_GPIO_LS_OE
, OMAP_PIN_OUTPUT
);
260 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD
, OMAP_PIN_OUTPUT
);
261 omap_mux_init_gpio(HDMI_GPIO_HPD
, OMAP_PIN_INPUT_PULLDOWN
);
264 void __init
omap_4430sdp_display_init_of(void)
268 /* Enable LCD2 by default (instead of Pico DLP) */
269 r
= gpio_request_one(DISPLAY_SEL_GPIO
, GPIOF_OUT_INIT_HIGH
,
272 pr_err("%s: Could not get display_sel GPIO\n", __func__
);
274 sdp4430_picodlp_init();
275 omap_display_init(&sdp4430_dss_data
);