Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
[deliverable/linux.git] / arch / arm / mach-omap2 / dss-common.c
CommitLineData
0191bf36
TV
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>
86cf29dc 27#include <linux/gpio.h>
7346582d 28#include <linux/platform_device.h>
86cf29dc 29
0191bf36 30#include <video/omapdss.h>
a0d8dde9 31#include <video/omap-panel-data.h>
0191bf36 32
e8d3d47a 33#include "soc.h"
0191bf36
TV
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
0191bf36
TV
41#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
42
7346582d
TV
43/* DVI Connector */
44static struct connector_dvi_platform_data omap4_panda_dvi_connector_pdata = {
45 .name = "dvi",
46 .source = "tfp410.0",
47 .i2c_bus_num = 2,
0191bf36
TV
48};
49
7346582d
TV
50static 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 */
57static 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
64static struct platform_device omap4_panda_tfp410_device = {
65 .name = "tfp410",
66 .id = 0,
67 .dev.platform_data = &omap4_panda_tfp410_pdata,
0191bf36
TV
68};
69
7346582d
TV
70/* HDMI Connector */
71static struct connector_hdmi_platform_data omap4_panda_hdmi_connector_pdata = {
72 .name = "hdmi",
73 .source = "tpd12s015.0",
74};
75
76static 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 */
83static struct encoder_tpd12s015_platform_data omap4_panda_tpd_pdata = {
84 .name = "tpd12s015.0",
85 .source = "hdmi.0",
86
0191bf36
TV
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
7346582d
TV
92static struct platform_device omap4_panda_tpd_device = {
93 .name = "tpd12s015",
94 .id = 0,
95 .dev.platform_data = &omap4_panda_tpd_pdata,
0191bf36
TV
96};
97
98static struct omap_dss_board_info omap4_panda_dss_data = {
7346582d 99 .default_display_name = "dvi",
0191bf36
TV
100};
101
0191bf36
TV
102void __init omap4_panda_display_init_of(void)
103{
104 omap_display_init(&omap4_panda_dss_data);
7346582d
TV
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);
0191bf36 111}
86cf29dc
TV
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
7346582d
TV
119static 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 },
86cf29dc 128 },
86cf29dc
TV
129};
130
7346582d
TV
131static struct platform_device sdp4430_lcd_device = {
132 .name = "panel-dsi-cm",
133 .id = 0,
134 .dev.platform_data = &dsi1_panel,
86cf29dc
TV
135};
136
7346582d
TV
137static 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 },
86cf29dc 146 },
86cf29dc
TV
147};
148
7346582d
TV
149static 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 */
156static struct connector_hdmi_platform_data sdp4430_hdmi_connector_pdata = {
157 .name = "hdmi",
158 .source = "tpd12s015.0",
159};
160
161static 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 */
168static struct encoder_tpd12s015_platform_data sdp4430_tpd_pdata = {
169 .name = "tpd12s015.0",
170 .source = "hdmi.0",
171
86cf29dc
TV
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
7346582d
TV
177static struct platform_device sdp4430_tpd_device = {
178 .name = "tpd12s015",
179 .id = 0,
180 .dev.platform_data = &sdp4430_tpd_pdata,
86cf29dc
TV
181};
182
7346582d 183
86cf29dc 184static struct omap_dss_board_info sdp4430_dss_data = {
7346582d 185 .default_display_name = "lcd",
86cf29dc
TV
186};
187
e5e53322
AT
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 */
86cf29dc
TV
194void __init omap_4430sdp_display_init_of(void)
195{
196 int r;
197
86cf29dc
TV
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
e5e53322
AT
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
86cf29dc 208 omap_display_init(&sdp4430_dss_data);
7346582d
TV
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);
86cf29dc 215}
This page took 0.077387 seconds and 5 git commands to generate.