blob: b073e8b651b3924d650cb8364771259defdecd84 [file] [log] [blame]
Tomi Valkeinen0191bf32012-11-05 15:14:17 +02001/*
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>
Tomi Valkeinen86cf29d2012-11-05 15:14:18 +020027#include <linux/gpio.h>
28
Tomi Valkeinen0191bf32012-11-05 15:14:17 +020029#include <video/omapdss.h>
Archit Tanejaa0d8dde2013-02-12 16:46:46 +053030#include <video/omap-panel-data.h>
Tomi Valkeinen0191bf32012-11-05 15:14:17 +020031
Tony Lindgrene8d3d472012-12-16 11:29:58 -080032#include "soc.h"
Tomi Valkeinen0191bf32012-11-05 15:14:17 +020033#include "dss-common.h"
34#include "mux.h"
35
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 */
39
40/* Display DVI */
41#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
42
43/* Using generic display panel */
44static struct tfp410_platform_data omap4_dvi_panel = {
45 .i2c_bus_num = 3,
46 .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
47};
48
49static struct omap_dss_device omap4_panda_dvi_device = {
50 .type = OMAP_DISPLAY_TYPE_DPI,
51 .name = "dvi",
52 .driver_name = "tfp410",
53 .data = &omap4_dvi_panel,
54 .phy.dpi.data_lines = 24,
55 .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
56 .channel = OMAP_DSS_CHANNEL_LCD2,
57};
58
59static struct omap_dss_hdmi_data omap4_panda_hdmi_data = {
60 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
61 .ls_oe_gpio = HDMI_GPIO_LS_OE,
62 .hpd_gpio = HDMI_GPIO_HPD,
63};
64
65static struct omap_dss_device omap4_panda_hdmi_device = {
66 .name = "hdmi",
67 .driver_name = "hdmi_panel",
68 .type = OMAP_DISPLAY_TYPE_HDMI,
69 .channel = OMAP_DSS_CHANNEL_DIGIT,
70 .data = &omap4_panda_hdmi_data,
71};
72
73static struct omap_dss_device *omap4_panda_dss_devices[] = {
74 &omap4_panda_dvi_device,
75 &omap4_panda_hdmi_device,
76};
77
78static struct omap_dss_board_info omap4_panda_dss_data = {
79 .num_devices = ARRAY_SIZE(omap4_panda_dss_devices),
80 .devices = omap4_panda_dss_devices,
81 .default_device = &omap4_panda_dvi_device,
82};
83
84void __init omap4_panda_display_init(void)
85{
86 omap_display_init(&omap4_panda_dss_data);
87
88 /*
89 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
90 * later have external pull up on the HDMI I2C lines
91 */
92 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2)
93 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP);
94 else
95 omap_hdmi_init(0);
96
97 omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
98 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
99 omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
100}
101
102void __init omap4_panda_display_init_of(void)
103{
104 omap_display_init(&omap4_panda_dss_data);
105}
Tomi Valkeinen86cf29d2012-11-05 15:14:18 +0200106
107
108/* OMAP4 Blaze display data */
109
110#define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
111#define DLP_POWER_ON_GPIO 40
112
113static struct nokia_dsi_panel_data dsi1_panel = {
114 .name = "taal",
115 .reset_gpio = 102,
116 .use_ext_te = false,
117 .ext_te_gpio = 101,
118 .esd_interval = 0,
119 .pin_config = {
120 .num_pins = 6,
121 .pins = { 0, 1, 2, 3, 4, 5 },
122 },
123};
124
125static struct omap_dss_device sdp4430_lcd_device = {
126 .name = "lcd",
127 .driver_name = "taal",
128 .type = OMAP_DISPLAY_TYPE_DSI,
129 .data = &dsi1_panel,
130 .phy.dsi = {
131 .module = 0,
132 },
133 .channel = OMAP_DSS_CHANNEL_LCD,
134};
135
136static struct nokia_dsi_panel_data dsi2_panel = {
137 .name = "taal",
138 .reset_gpio = 104,
139 .use_ext_te = false,
140 .ext_te_gpio = 103,
141 .esd_interval = 0,
142 .pin_config = {
143 .num_pins = 6,
144 .pins = { 0, 1, 2, 3, 4, 5 },
145 },
146};
147
148static struct omap_dss_device sdp4430_lcd2_device = {
149 .name = "lcd2",
150 .driver_name = "taal",
151 .type = OMAP_DISPLAY_TYPE_DSI,
152 .data = &dsi2_panel,
153 .phy.dsi = {
154
155 .module = 1,
156 },
157 .channel = OMAP_DSS_CHANNEL_LCD2,
158};
159
160static struct omap_dss_hdmi_data sdp4430_hdmi_data = {
161 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
162 .ls_oe_gpio = HDMI_GPIO_LS_OE,
163 .hpd_gpio = HDMI_GPIO_HPD,
164};
165
166static struct omap_dss_device sdp4430_hdmi_device = {
167 .name = "hdmi",
168 .driver_name = "hdmi_panel",
169 .type = OMAP_DISPLAY_TYPE_HDMI,
170 .channel = OMAP_DSS_CHANNEL_DIGIT,
171 .data = &sdp4430_hdmi_data,
172};
173
174static struct picodlp_panel_data sdp4430_picodlp_pdata = {
175 .picodlp_adapter_id = 2,
176 .emu_done_gpio = 44,
177 .pwrgood_gpio = 45,
178};
179
Tomi Valkeinen86cf29d2012-11-05 15:14:18 +0200180static struct omap_dss_device sdp4430_picodlp_device = {
181 .name = "picodlp",
182 .driver_name = "picodlp_panel",
183 .type = OMAP_DISPLAY_TYPE_DPI,
184 .phy.dpi.data_lines = 24,
185 .channel = OMAP_DSS_CHANNEL_LCD2,
Tomi Valkeinen86cf29d2012-11-05 15:14:18 +0200186 .data = &sdp4430_picodlp_pdata,
187};
188
189static struct omap_dss_device *sdp4430_dss_devices[] = {
190 &sdp4430_lcd_device,
191 &sdp4430_lcd2_device,
192 &sdp4430_hdmi_device,
193 &sdp4430_picodlp_device,
194};
195
196static struct omap_dss_board_info sdp4430_dss_data = {
197 .num_devices = ARRAY_SIZE(sdp4430_dss_devices),
198 .devices = sdp4430_dss_devices,
199 .default_device = &sdp4430_lcd_device,
200};
201
Archit Tanejae5e53322013-02-04 12:23:02 +0530202/*
203 * we select LCD2 by default (instead of Pico DLP) by setting DISPLAY_SEL_GPIO.
204 * Setting DLP_POWER_ON gpio enables the VDLP_2V5 VDLP_1V8 and VDLP_1V0 rails
205 * used by picodlp on the 4430sdp platform. Keep this gpio disabled as LCD2 is
206 * selected by default
207 */
Tomi Valkeinen86cf29d2012-11-05 15:14:18 +0200208void __init omap_4430sdp_display_init(void)
209{
210 int r;
211
Tomi Valkeinen86cf29d2012-11-05 15:14:18 +0200212 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
213 "display_sel");
214 if (r)
215 pr_err("%s: Could not get display_sel GPIO\n", __func__);
216
Archit Tanejae5e53322013-02-04 12:23:02 +0530217 r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
218 "DLP POWER ON");
219 if (r)
220 pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
221
Tomi Valkeinen86cf29d2012-11-05 15:14:18 +0200222 omap_display_init(&sdp4430_dss_data);
223 /*
224 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
225 * later have external pull up on the HDMI I2C lines
226 */
227 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2)
228 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP);
229 else
230 omap_hdmi_init(0);
231
232 omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
233 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
234 omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
235}
236
237void __init omap_4430sdp_display_init_of(void)
238{
239 int r;
240
Tomi Valkeinen86cf29d2012-11-05 15:14:18 +0200241 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
242 "display_sel");
243 if (r)
244 pr_err("%s: Could not get display_sel GPIO\n", __func__);
245
Archit Tanejae5e53322013-02-04 12:23:02 +0530246 r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
247 "DLP POWER ON");
248 if (r)
249 pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
250
Tomi Valkeinen86cf29d2012-11-05 15:14:18 +0200251 omap_display_init(&sdp4430_dss_data);
252}