x86/xen: resume timer irqs early
[linux/fpc-iii.git] / arch / arm / mach-omap2 / dss-common.c
blobbf89effa4c9988a45c770175307e632918790a4a
1 /*
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
17 * 02110-1301 USA
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>
33 #include "soc.h"
34 #include "dss-common.h"
35 #include "mux.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
43 /* DVI Connector */
44 static struct connector_dvi_platform_data omap4_panda_dvi_connector_pdata = {
45 .name = "dvi",
46 .source = "tfp410.0",
47 .i2c_bus_num = 2,
50 static struct platform_device omap4_panda_dvi_connector_device = {
51 .name = "connector-dvi",
52 .id = 0,
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 = {
58 .name = "tfp410.0",
59 .source = "dpi.0",
60 .data_lines = 24,
61 .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
64 static struct platform_device omap4_panda_tfp410_device = {
65 .name = "tfp410",
66 .id = 0,
67 .dev.platform_data = &omap4_panda_tfp410_pdata,
70 /* HDMI Connector */
71 static struct connector_hdmi_platform_data omap4_panda_hdmi_connector_pdata = {
72 .name = "hdmi",
73 .source = "tpd12s015.0",
76 static struct platform_device omap4_panda_hdmi_connector_device = {
77 .name = "connector-hdmi",
78 .id = 0,
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",
85 .source = "hdmi.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 = {
93 .name = "tpd12s015",
94 .id = 0,
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 = {
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 },
131 static struct platform_device sdp4430_lcd_device = {
132 .name = "panel-dsi-cm",
133 .id = 0,
134 .dev.platform_data = &dsi1_panel,
137 static 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 },
149 static struct platform_device sdp4430_lcd2_device = {
150 .name = "panel-dsi-cm",
151 .id = 1,
152 .dev.platform_data = &dsi2_panel,
155 /* HDMI Connector */
156 static struct connector_hdmi_platform_data sdp4430_hdmi_connector_pdata = {
157 .name = "hdmi",
158 .source = "tpd12s015.0",
161 static struct platform_device sdp4430_hdmi_connector_device = {
162 .name = "connector-hdmi",
163 .id = 0,
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",
170 .source = "hdmi.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 = {
178 .name = "tpd12s015",
179 .id = 0,
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)
196 int r;
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__);
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__);
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);