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>
28 #include <linux/platform_device.h>
30 #include <video/omapdss.h>
31 #include <video/omap-panel-data.h>
34 #include "dss-common.h"
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 */
41 #define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
44 static struct connector_dvi_platform_data omap4_panda_dvi_connector_pdata = {
50 static struct platform_device omap4_panda_dvi_connector_device = {
51 .name = "connector-dvi",
53 .dev.platform_data = &omap4_panda_dvi_connector_pdata,
56 /* TFP410 DPI-to-DVI chip */
57 static struct encoder_tfp410_platform_data omap4_panda_tfp410_pdata = {
61 .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
64 static struct platform_device omap4_panda_tfp410_device = {
67 .dev.platform_data = &omap4_panda_tfp410_pdata,
71 static struct connector_hdmi_platform_data omap4_panda_hdmi_connector_pdata = {
73 .source = "tpd12s015.0",
76 static struct platform_device omap4_panda_hdmi_connector_device = {
77 .name = "connector-hdmi",
79 .dev.platform_data = &omap4_panda_hdmi_connector_pdata,
82 /* TPD12S015 HDMI ESD protection & level shifter chip */
83 static struct encoder_tpd12s015_platform_data omap4_panda_tpd_pdata = {
84 .name = "tpd12s015.0",
87 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
88 .ls_oe_gpio = HDMI_GPIO_LS_OE,
89 .hpd_gpio = HDMI_GPIO_HPD,
92 static struct platform_device omap4_panda_tpd_device = {
95 .dev.platform_data = &omap4_panda_tpd_pdata,
98 static struct omap_dss_board_info omap4_panda_dss_data = {
99 .default_display_name = "dvi",
102 void __init omap4_panda_display_init_of(void)
104 omap_display_init(&omap4_panda_dss_data);
106 platform_device_register(&omap4_panda_tfp410_device);
107 platform_device_register(&omap4_panda_dvi_connector_device);
109 platform_device_register(&omap4_panda_tpd_device);
110 platform_device_register(&omap4_panda_hdmi_connector_device);
114 /* OMAP4 Blaze display data */
116 #define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
117 #define DLP_POWER_ON_GPIO 40
119 static struct panel_dsicm_platform_data dsi1_panel = {
127 .pins = { 0, 1, 2, 3, 4, 5 },
131 static struct platform_device sdp4430_lcd_device = {
132 .name = "panel-dsi-cm",
134 .dev.platform_data = &dsi1_panel,
137 static struct panel_dsicm_platform_data dsi2_panel = {
145 .pins = { 0, 1, 2, 3, 4, 5 },
149 static struct platform_device sdp4430_lcd2_device = {
150 .name = "panel-dsi-cm",
152 .dev.platform_data = &dsi2_panel,
156 static struct connector_hdmi_platform_data sdp4430_hdmi_connector_pdata = {
158 .source = "tpd12s015.0",
161 static struct platform_device sdp4430_hdmi_connector_device = {
162 .name = "connector-hdmi",
164 .dev.platform_data = &sdp4430_hdmi_connector_pdata,
167 /* TPD12S015 HDMI ESD protection & level shifter chip */
168 static struct encoder_tpd12s015_platform_data sdp4430_tpd_pdata = {
169 .name = "tpd12s015.0",
172 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
173 .ls_oe_gpio = HDMI_GPIO_LS_OE,
174 .hpd_gpio = HDMI_GPIO_HPD,
177 static struct platform_device sdp4430_tpd_device = {
180 .dev.platform_data = &sdp4430_tpd_pdata,
184 static struct omap_dss_board_info sdp4430_dss_data = {
185 .default_display_name = "lcd",
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
194 void __init omap_4430sdp_display_init_of(void)
198 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
201 pr_err("%s: Could not get display_sel GPIO\n", __func__);
203 r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
206 pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
208 omap_display_init(&sdp4430_dss_data);
210 platform_device_register(&sdp4430_lcd_device);
211 platform_device_register(&sdp4430_lcd2_device);
213 platform_device_register(&sdp4430_tpd_device);
214 platform_device_register(&sdp4430_hdmi_connector_device);
218 /* OMAP3 IGEPv2 data */
220 #define IGEP2_DVI_TFP410_POWER_DOWN_GPIO 170
223 static struct connector_dvi_platform_data omap3_igep2_dvi_connector_pdata = {
225 .source = "tfp410.0",
229 static struct platform_device omap3_igep2_dvi_connector_device = {
230 .name = "connector-dvi",
232 .dev.platform_data = &omap3_igep2_dvi_connector_pdata,
235 /* TFP410 DPI-to-DVI chip */
236 static struct encoder_tfp410_platform_data omap3_igep2_tfp410_pdata = {
240 .power_down_gpio = IGEP2_DVI_TFP410_POWER_DOWN_GPIO,
243 static struct platform_device omap3_igep2_tfp410_device = {
246 .dev.platform_data = &omap3_igep2_tfp410_pdata,
249 static struct omap_dss_board_info igep2_dss_data = {
250 .default_display_name = "dvi",
253 void __init omap3_igep2_display_init_of(void)
255 omap_display_init(&igep2_dss_data);
257 platform_device_register(&omap3_igep2_tfp410_device);
258 platform_device_register(&omap3_igep2_dvi_connector_device);