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>
35 #include "dss-common.h"
38 #define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
39 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
40 #define HDMI_GPIO_HPD 63 /* Hotplug detect */
43 #define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
45 /* Using generic display panel */
46 static struct tfp410_platform_data omap4_dvi_panel
= {
48 .power_down_gpio
= PANDA_DVI_TFP410_POWER_DOWN_GPIO
,
51 static struct omap_dss_device omap4_panda_dvi_device
= {
52 .type
= OMAP_DISPLAY_TYPE_DPI
,
54 .driver_name
= "tfp410",
55 .data
= &omap4_dvi_panel
,
56 .phy
.dpi
.data_lines
= 24,
57 .reset_gpio
= PANDA_DVI_TFP410_POWER_DOWN_GPIO
,
58 .channel
= OMAP_DSS_CHANNEL_LCD2
,
61 static struct omap_dss_hdmi_data omap4_panda_hdmi_data
= {
62 .ct_cp_hpd_gpio
= HDMI_GPIO_CT_CP_HPD
,
63 .ls_oe_gpio
= HDMI_GPIO_LS_OE
,
64 .hpd_gpio
= HDMI_GPIO_HPD
,
67 static struct omap_dss_device omap4_panda_hdmi_device
= {
69 .driver_name
= "hdmi_panel",
70 .type
= OMAP_DISPLAY_TYPE_HDMI
,
71 .channel
= OMAP_DSS_CHANNEL_DIGIT
,
72 .data
= &omap4_panda_hdmi_data
,
75 static struct omap_dss_device
*omap4_panda_dss_devices
[] = {
76 &omap4_panda_dvi_device
,
77 &omap4_panda_hdmi_device
,
80 static struct omap_dss_board_info omap4_panda_dss_data
= {
81 .num_devices
= ARRAY_SIZE(omap4_panda_dss_devices
),
82 .devices
= omap4_panda_dss_devices
,
83 .default_device
= &omap4_panda_dvi_device
,
86 void __init
omap4_panda_display_init(void)
88 omap_display_init(&omap4_panda_dss_data
);
91 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
92 * later have external pull up on the HDMI I2C lines
94 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2
)
95 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP
);
99 omap_mux_init_gpio(HDMI_GPIO_LS_OE
, OMAP_PIN_OUTPUT
);
100 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD
, OMAP_PIN_OUTPUT
);
101 omap_mux_init_gpio(HDMI_GPIO_HPD
, OMAP_PIN_INPUT_PULLDOWN
);
104 void __init
omap4_panda_display_init_of(void)
106 omap_display_init(&omap4_panda_dss_data
);
110 /* OMAP4 Blaze display data */
112 #define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
113 #define DLP_POWER_ON_GPIO 40
115 static struct nokia_dsi_panel_data dsi1_panel
= {
123 .pins
= { 0, 1, 2, 3, 4, 5 },
127 static struct omap_dss_device sdp4430_lcd_device
= {
129 .driver_name
= "taal",
130 .type
= OMAP_DISPLAY_TYPE_DSI
,
135 .channel
= OMAP_DSS_CHANNEL_LCD
,
138 static struct nokia_dsi_panel_data dsi2_panel
= {
146 .pins
= { 0, 1, 2, 3, 4, 5 },
150 static struct omap_dss_device sdp4430_lcd2_device
= {
152 .driver_name
= "taal",
153 .type
= OMAP_DISPLAY_TYPE_DSI
,
159 .channel
= OMAP_DSS_CHANNEL_LCD2
,
162 static struct omap_dss_hdmi_data sdp4430_hdmi_data
= {
163 .ct_cp_hpd_gpio
= HDMI_GPIO_CT_CP_HPD
,
164 .ls_oe_gpio
= HDMI_GPIO_LS_OE
,
165 .hpd_gpio
= HDMI_GPIO_HPD
,
168 static struct omap_dss_device sdp4430_hdmi_device
= {
170 .driver_name
= "hdmi_panel",
171 .type
= OMAP_DISPLAY_TYPE_HDMI
,
172 .channel
= OMAP_DSS_CHANNEL_DIGIT
,
173 .data
= &sdp4430_hdmi_data
,
176 static struct picodlp_panel_data sdp4430_picodlp_pdata
= {
177 .picodlp_adapter_id
= 2,
182 static void sdp4430_picodlp_init(void)
185 const struct gpio picodlp_gpios
[] = {
186 {DLP_POWER_ON_GPIO
, GPIOF_OUT_INIT_LOW
,
188 {sdp4430_picodlp_pdata
.emu_done_gpio
, GPIOF_IN
,
190 {sdp4430_picodlp_pdata
.pwrgood_gpio
, GPIOF_OUT_INIT_LOW
,
194 r
= gpio_request_array(picodlp_gpios
, ARRAY_SIZE(picodlp_gpios
));
196 pr_err("Cannot request PicoDLP GPIOs, error %d\n", r
);
199 static int sdp4430_panel_enable_picodlp(struct omap_dss_device
*dssdev
)
201 gpio_set_value(DISPLAY_SEL_GPIO
, 0);
202 gpio_set_value(DLP_POWER_ON_GPIO
, 1);
207 static void sdp4430_panel_disable_picodlp(struct omap_dss_device
*dssdev
)
209 gpio_set_value(DLP_POWER_ON_GPIO
, 0);
210 gpio_set_value(DISPLAY_SEL_GPIO
, 1);
213 static struct omap_dss_device sdp4430_picodlp_device
= {
215 .driver_name
= "picodlp_panel",
216 .type
= OMAP_DISPLAY_TYPE_DPI
,
217 .phy
.dpi
.data_lines
= 24,
218 .channel
= OMAP_DSS_CHANNEL_LCD2
,
219 .platform_enable
= sdp4430_panel_enable_picodlp
,
220 .platform_disable
= sdp4430_panel_disable_picodlp
,
221 .data
= &sdp4430_picodlp_pdata
,
224 static struct omap_dss_device
*sdp4430_dss_devices
[] = {
226 &sdp4430_lcd2_device
,
227 &sdp4430_hdmi_device
,
228 &sdp4430_picodlp_device
,
231 static struct omap_dss_board_info sdp4430_dss_data
= {
232 .num_devices
= ARRAY_SIZE(sdp4430_dss_devices
),
233 .devices
= sdp4430_dss_devices
,
234 .default_device
= &sdp4430_lcd_device
,
237 void __init
omap_4430sdp_display_init(void)
241 /* Enable LCD2 by default (instead of Pico DLP) */
242 r
= gpio_request_one(DISPLAY_SEL_GPIO
, GPIOF_OUT_INIT_HIGH
,
245 pr_err("%s: Could not get display_sel GPIO\n", __func__
);
247 sdp4430_picodlp_init();
248 omap_display_init(&sdp4430_dss_data
);
250 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
251 * later have external pull up on the HDMI I2C lines
253 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2
)
254 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP
);
258 omap_mux_init_gpio(HDMI_GPIO_LS_OE
, OMAP_PIN_OUTPUT
);
259 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD
, OMAP_PIN_OUTPUT
);
260 omap_mux_init_gpio(HDMI_GPIO_HPD
, OMAP_PIN_INPUT_PULLDOWN
);
263 void __init
omap_4430sdp_display_init_of(void)
267 /* Enable LCD2 by default (instead of Pico DLP) */
268 r
= gpio_request_one(DISPLAY_SEL_GPIO
, GPIOF_OUT_INIT_HIGH
,
271 pr_err("%s: Could not get display_sel GPIO\n", __func__
);
273 sdp4430_picodlp_init();
274 omap_display_init(&sdp4430_dss_data
);