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-data.h>
33 #include "dss-common.h"
36 #define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
37 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
38 #define HDMI_GPIO_HPD 63 /* Hotplug detect */
41 #define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
43 /* Using generic display panel */
44 static struct tfp410_platform_data omap4_dvi_panel
= {
46 .power_down_gpio
= PANDA_DVI_TFP410_POWER_DOWN_GPIO
,
49 static struct omap_dss_device omap4_panda_dvi_device
= {
50 .type
= OMAP_DISPLAY_TYPE_DPI
,
52 .driver_name
= "tfp410",
53 .data
= &omap4_dvi_panel
,
54 .phy
.dpi
.data_lines
= 24,
55 .channel
= OMAP_DSS_CHANNEL_LCD2
,
58 static struct omap_dss_hdmi_data omap4_panda_hdmi_data
= {
59 .ct_cp_hpd_gpio
= HDMI_GPIO_CT_CP_HPD
,
60 .ls_oe_gpio
= HDMI_GPIO_LS_OE
,
61 .hpd_gpio
= HDMI_GPIO_HPD
,
64 static struct omap_dss_device omap4_panda_hdmi_device
= {
66 .driver_name
= "hdmi_panel",
67 .type
= OMAP_DISPLAY_TYPE_HDMI
,
68 .channel
= OMAP_DSS_CHANNEL_DIGIT
,
69 .data
= &omap4_panda_hdmi_data
,
72 static struct omap_dss_device
*omap4_panda_dss_devices
[] = {
73 &omap4_panda_dvi_device
,
74 &omap4_panda_hdmi_device
,
77 static struct omap_dss_board_info omap4_panda_dss_data
= {
78 .num_devices
= ARRAY_SIZE(omap4_panda_dss_devices
),
79 .devices
= omap4_panda_dss_devices
,
80 .default_device
= &omap4_panda_dvi_device
,
83 void __init
omap4_panda_display_init(void)
85 omap_display_init(&omap4_panda_dss_data
);
88 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
89 * later have external pull up on the HDMI I2C lines
91 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2
)
92 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP
);
96 omap_mux_init_gpio(HDMI_GPIO_LS_OE
, OMAP_PIN_OUTPUT
);
97 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD
, OMAP_PIN_OUTPUT
);
98 omap_mux_init_gpio(HDMI_GPIO_HPD
, OMAP_PIN_INPUT_PULLDOWN
);
101 void __init
omap4_panda_display_init_of(void)
103 omap_display_init(&omap4_panda_dss_data
);
107 /* OMAP4 Blaze display data */
109 #define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
110 #define DLP_POWER_ON_GPIO 40
112 static struct nokia_dsi_panel_data dsi1_panel
= {
120 .pins
= { 0, 1, 2, 3, 4, 5 },
124 static struct omap_dss_device sdp4430_lcd_device
= {
126 .driver_name
= "taal",
127 .type
= OMAP_DISPLAY_TYPE_DSI
,
132 .channel
= OMAP_DSS_CHANNEL_LCD
,
135 static struct nokia_dsi_panel_data dsi2_panel
= {
143 .pins
= { 0, 1, 2, 3, 4, 5 },
147 static struct omap_dss_device sdp4430_lcd2_device
= {
149 .driver_name
= "taal",
150 .type
= OMAP_DISPLAY_TYPE_DSI
,
156 .channel
= OMAP_DSS_CHANNEL_LCD2
,
159 static struct omap_dss_hdmi_data sdp4430_hdmi_data
= {
160 .ct_cp_hpd_gpio
= HDMI_GPIO_CT_CP_HPD
,
161 .ls_oe_gpio
= HDMI_GPIO_LS_OE
,
162 .hpd_gpio
= HDMI_GPIO_HPD
,
165 static struct omap_dss_device sdp4430_hdmi_device
= {
167 .driver_name
= "hdmi_panel",
168 .type
= OMAP_DISPLAY_TYPE_HDMI
,
169 .channel
= OMAP_DSS_CHANNEL_DIGIT
,
170 .data
= &sdp4430_hdmi_data
,
173 static struct picodlp_panel_data sdp4430_picodlp_pdata
= {
174 .picodlp_adapter_id
= 2,
179 static struct omap_dss_device sdp4430_picodlp_device
= {
181 .driver_name
= "picodlp_panel",
182 .type
= OMAP_DISPLAY_TYPE_DPI
,
183 .phy
.dpi
.data_lines
= 24,
184 .channel
= OMAP_DSS_CHANNEL_LCD2
,
185 .data
= &sdp4430_picodlp_pdata
,
188 static struct omap_dss_device
*sdp4430_dss_devices
[] = {
190 &sdp4430_lcd2_device
,
191 &sdp4430_hdmi_device
,
192 &sdp4430_picodlp_device
,
195 static struct omap_dss_board_info sdp4430_dss_data
= {
196 .num_devices
= ARRAY_SIZE(sdp4430_dss_devices
),
197 .devices
= sdp4430_dss_devices
,
198 .default_device
= &sdp4430_lcd_device
,
202 * we select LCD2 by default (instead of Pico DLP) by setting DISPLAY_SEL_GPIO.
203 * Setting DLP_POWER_ON gpio enables the VDLP_2V5 VDLP_1V8 and VDLP_1V0 rails
204 * used by picodlp on the 4430sdp platform. Keep this gpio disabled as LCD2 is
205 * selected by default
207 void __init
omap_4430sdp_display_init(void)
211 r
= gpio_request_one(DISPLAY_SEL_GPIO
, GPIOF_OUT_INIT_HIGH
,
214 pr_err("%s: Could not get display_sel GPIO\n", __func__
);
216 r
= gpio_request_one(DLP_POWER_ON_GPIO
, GPIOF_OUT_INIT_LOW
,
219 pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__
);
221 omap_display_init(&sdp4430_dss_data
);
223 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
224 * later have external pull up on the HDMI I2C lines
226 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2
)
227 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP
);
231 omap_mux_init_gpio(HDMI_GPIO_LS_OE
, OMAP_PIN_OUTPUT
);
232 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD
, OMAP_PIN_OUTPUT
);
233 omap_mux_init_gpio(HDMI_GPIO_HPD
, OMAP_PIN_INPUT_PULLDOWN
);
236 void __init
omap_4430sdp_display_init_of(void)
240 r
= gpio_request_one(DISPLAY_SEL_GPIO
, GPIOF_OUT_INIT_HIGH
,
243 pr_err("%s: Could not get display_sel GPIO\n", __func__
);
245 r
= gpio_request_one(DLP_POWER_ON_GPIO
, GPIOF_OUT_INIT_LOW
,
248 pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__
);
250 omap_display_init(&sdp4430_dss_data
);