aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2013-02-04 01:53:02 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-04 04:51:12 -0400
commite5e533227ad8b6412cdec371a143ac2944272e2d (patch)
tree3b3531d52c57487599ab2f04e2cdf2b257270ec4
parent2af2ac7a2807ef711094b51a969aa656d26cb33a (diff)
arm: omap: dss-common: use picodlp panel's gpio handling
The dss-common file currently requests gpios required by the picodlp DPI panel on the 4430sdp/blaze board. It also requests DISPLAY_SEL_GPIO and DLP_POWER_ON_GPIO gpios which are board specific gpios to switch between lcd2 panel and picodlp, and setting intermediate power supplies for picodlp respectively. These gpios are toggled through platform_enable/disable functions called by the picodlp driver. Remove the gpio requests for the gpios which are already requested by the panel driver, and remove the platform callback functions and set the platform specific gpios in such a way that lcd2 panel is selected for the LCD2 overlay manager and the power supplies for picodlp are disabled. Note: We need to revisit this so that we can enable and switch to picodlp if that's the only panel driver available for the LCD2 overlay manager. Signed-off-by: Archit Taneja <archit@ti.com> Cc: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/dss-common.c53
1 files changed, 16 insertions, 37 deletions
diff --git a/arch/arm/mach-omap2/dss-common.c b/arch/arm/mach-omap2/dss-common.c
index 9c49bbe825f7..b073e8b651b3 100644
--- a/arch/arm/mach-omap2/dss-common.c
+++ b/arch/arm/mach-omap2/dss-common.c
@@ -177,45 +177,12 @@ static struct picodlp_panel_data sdp4430_picodlp_pdata = {
177 .pwrgood_gpio = 45, 177 .pwrgood_gpio = 45,
178}; 178};
179 179
180static void sdp4430_picodlp_init(void)
181{
182 int r;
183 const struct gpio picodlp_gpios[] = {
184 {DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
185 "DLP POWER ON"},
186 {sdp4430_picodlp_pdata.emu_done_gpio, GPIOF_IN,
187 "DLP EMU DONE"},
188 {sdp4430_picodlp_pdata.pwrgood_gpio, GPIOF_OUT_INIT_LOW,
189 "DLP PWRGOOD"},
190 };
191
192 r = gpio_request_array(picodlp_gpios, ARRAY_SIZE(picodlp_gpios));
193 if (r)
194 pr_err("Cannot request PicoDLP GPIOs, error %d\n", r);
195}
196
197static int sdp4430_panel_enable_picodlp(struct omap_dss_device *dssdev)
198{
199 gpio_set_value(DISPLAY_SEL_GPIO, 0);
200 gpio_set_value(DLP_POWER_ON_GPIO, 1);
201
202 return 0;
203}
204
205static void sdp4430_panel_disable_picodlp(struct omap_dss_device *dssdev)
206{
207 gpio_set_value(DLP_POWER_ON_GPIO, 0);
208 gpio_set_value(DISPLAY_SEL_GPIO, 1);
209}
210
211static struct omap_dss_device sdp4430_picodlp_device = { 180static struct omap_dss_device sdp4430_picodlp_device = {
212 .name = "picodlp", 181 .name = "picodlp",
213 .driver_name = "picodlp_panel", 182 .driver_name = "picodlp_panel",
214 .type = OMAP_DISPLAY_TYPE_DPI, 183 .type = OMAP_DISPLAY_TYPE_DPI,
215 .phy.dpi.data_lines = 24, 184 .phy.dpi.data_lines = 24,
216 .channel = OMAP_DSS_CHANNEL_LCD2, 185 .channel = OMAP_DSS_CHANNEL_LCD2,
217 .platform_enable = sdp4430_panel_enable_picodlp,
218 .platform_disable = sdp4430_panel_disable_picodlp,
219 .data = &sdp4430_picodlp_pdata, 186 .data = &sdp4430_picodlp_pdata,
220}; 187};
221 188
@@ -232,17 +199,26 @@ static struct omap_dss_board_info sdp4430_dss_data = {
232 .default_device = &sdp4430_lcd_device, 199 .default_device = &sdp4430_lcd_device,
233}; 200};
234 201
202/*
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 */
235void __init omap_4430sdp_display_init(void) 208void __init omap_4430sdp_display_init(void)
236{ 209{
237 int r; 210 int r;
238 211
239 /* Enable LCD2 by default (instead of Pico DLP) */
240 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH, 212 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
241 "display_sel"); 213 "display_sel");
242 if (r) 214 if (r)
243 pr_err("%s: Could not get display_sel GPIO\n", __func__); 215 pr_err("%s: Could not get display_sel GPIO\n", __func__);
244 216
245 sdp4430_picodlp_init(); 217 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
246 omap_display_init(&sdp4430_dss_data); 222 omap_display_init(&sdp4430_dss_data);
247 /* 223 /*
248 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and 224 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
@@ -262,12 +238,15 @@ void __init omap_4430sdp_display_init_of(void)
262{ 238{
263 int r; 239 int r;
264 240
265 /* Enable LCD2 by default (instead of Pico DLP) */
266 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH, 241 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
267 "display_sel"); 242 "display_sel");
268 if (r) 243 if (r)
269 pr_err("%s: Could not get display_sel GPIO\n", __func__); 244 pr_err("%s: Could not get display_sel GPIO\n", __func__);
270 245
271 sdp4430_picodlp_init(); 246 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
272 omap_display_init(&sdp4430_dss_data); 251 omap_display_init(&sdp4430_dss_data);
273} 252}