aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-03 05:35:06 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-04 04:50:31 -0400
commite471e9ad57252ca46b9577c4cb3c6c08e6889bbf (patch)
treecb65aaca28b9f65ba05d95352aad4d3bb4927b6a /arch/arm/mach-omap2
parent9272d8bd4a56fcee4da827418b1dcf8b261cd380 (diff)
arm: omap: board-cm-t35: use generic dpi panel's gpio handling
The cm-t35 board file currently requests gpios required to configure the tdo35s panel, and provides platform_enable/disable callbacks to configure them. These tasks have been moved to the generic dpi panel driver itself and shouldn't be done in the board files. Remove the gpio requests and the platform callbacks from the board file. Add the gpio information to generic dpi panel's platform data so that it's passed to the panel driver. Note: Only BL enable gpio is handled in the panel driver. The LCD enable GPIO is handled in the board file at init time, as there's a 50 ms delay required when using the GPIO, and the panel driver doesn't know about that. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Tony Lindgren <tony@atomide.com> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c49
1 files changed, 9 insertions, 40 deletions
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index bccd3e51fecb..cccbfea2fab3 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -190,32 +190,6 @@ static inline void cm_t35_init_nand(void) {}
190#define CM_T35_LCD_BL_GPIO 58 190#define CM_T35_LCD_BL_GPIO 58
191#define CM_T35_DVI_EN_GPIO 54 191#define CM_T35_DVI_EN_GPIO 54
192 192
193static int lcd_enabled;
194static int dvi_enabled;
195
196static int cm_t35_panel_enable_lcd(struct omap_dss_device *dssdev)
197{
198 if (dvi_enabled) {
199 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
200 return -EINVAL;
201 }
202
203 gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
204 gpio_set_value(CM_T35_LCD_BL_GPIO, 1);
205
206 lcd_enabled = 1;
207
208 return 0;
209}
210
211static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev)
212{
213 lcd_enabled = 0;
214
215 gpio_set_value(CM_T35_LCD_BL_GPIO, 0);
216 gpio_set_value(CM_T35_LCD_EN_GPIO, 0);
217}
218
219static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev) 193static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev)
220{ 194{
221 return 0; 195 return 0;
@@ -227,8 +201,10 @@ static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev)
227 201
228static struct panel_generic_dpi_data lcd_panel = { 202static struct panel_generic_dpi_data lcd_panel = {
229 .name = "toppoly_tdo35s", 203 .name = "toppoly_tdo35s",
230 .platform_enable = cm_t35_panel_enable_lcd, 204 .num_gpios = 1,
231 .platform_disable = cm_t35_panel_disable_lcd, 205 .gpios = {
206 CM_T35_LCD_BL_GPIO,
207 },
232}; 208};
233 209
234static struct omap_dss_device cm_t35_lcd_device = { 210static struct omap_dss_device cm_t35_lcd_device = {
@@ -292,11 +268,6 @@ static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = {
292 }, 268 },
293}; 269};
294 270
295static struct gpio cm_t35_dss_gpios[] __initdata = {
296 { CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW, "lcd enable" },
297 { CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW, "lcd bl enable" },
298};
299
300static void __init cm_t35_init_display(void) 271static void __init cm_t35_init_display(void)
301{ 272{
302 int err; 273 int err;
@@ -304,23 +275,21 @@ static void __init cm_t35_init_display(void)
304 spi_register_board_info(cm_t35_lcd_spi_board_info, 275 spi_register_board_info(cm_t35_lcd_spi_board_info,
305 ARRAY_SIZE(cm_t35_lcd_spi_board_info)); 276 ARRAY_SIZE(cm_t35_lcd_spi_board_info));
306 277
307 err = gpio_request_array(cm_t35_dss_gpios, 278
308 ARRAY_SIZE(cm_t35_dss_gpios)); 279 err = gpio_request_one(CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW,
280 "lcd bl enable");
309 if (err) { 281 if (err) {
310 pr_err("CM-T35: failed to request DSS control GPIOs\n"); 282 pr_err("CM-T35: failed to request LCD EN GPIO\n");
311 return; 283 return;
312 } 284 }
313 285
314 gpio_export(CM_T35_LCD_EN_GPIO, 0);
315 gpio_export(CM_T35_LCD_BL_GPIO, 0);
316
317 msleep(50); 286 msleep(50);
318 gpio_set_value(CM_T35_LCD_EN_GPIO, 1); 287 gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
319 288
320 err = omap_display_init(&cm_t35_dss_data); 289 err = omap_display_init(&cm_t35_dss_data);
321 if (err) { 290 if (err) {
322 pr_err("CM-T35: failed to register DSS device\n"); 291 pr_err("CM-T35: failed to register DSS device\n");
323 gpio_free_array(cm_t35_dss_gpios, ARRAY_SIZE(cm_t35_dss_gpios)); 292 gpio_free(CM_T35_LCD_EN_GPIO);
324 } 293 }
325} 294}
326 295