arm: omap: board-am3517: use generic dpi panel's gpio handling
authorArchit Taneja <archit@ti.com>
Mon, 3 Dec 2012 11:11:41 +0000 (16:41 +0530)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 4 Apr 2013 08:50:36 +0000 (11:50 +0300)
The am3517 board file currently requests gpios required to configure the sharp
lq DPI 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: It's not clear why the GPIOs were muxed as input signals in PULL down mode
in am3517_evm_display_init(). Also, only the LCD_PANEL_PWR was toggled in the
platform_enable/disable calls, the generic DPI panel driver will now toggle all
the three gpios on panel's disable/enable. We need to test if these changes to
see if they have any impact or not.

Signed-off-by: Archit Taneja <archit@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Vaibhav Hiremath <hvaibhav@ti.com>
arch/arm/mach-omap2/board-am3517evm.c

index 1d6c288..4ba395f 100644 (file)
@@ -120,63 +120,14 @@ static int __init am3517_evm_i2c_init(void)
        return 0;
 }
 
-static int lcd_enabled;
-static int dvi_enabled;
-
-#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
-               defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
-static struct gpio am3517_evm_dss_gpios[] __initdata = {
-       /* GPIO 182 = LCD Backlight Power */
-       { LCD_PANEL_BKLIGHT_PWR, GPIOF_OUT_INIT_HIGH, "lcd_backlight_pwr" },
-       /* GPIO 181 = LCD Panel PWM */
-       { LCD_PANEL_PWM,         GPIOF_OUT_INIT_HIGH, "lcd bl enable"     },
-       /* GPIO 176 = LCD Panel Power enable pin */
-       { LCD_PANEL_PWR,         GPIOF_OUT_INIT_HIGH, "dvi enable"        },
-};
-
-static void __init am3517_evm_display_init(void)
-{
-       int r;
-
-       omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP);
-       omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN);
-       omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN);
-
-       r = gpio_request_array(am3517_evm_dss_gpios,
-                              ARRAY_SIZE(am3517_evm_dss_gpios));
-       if (r) {
-               printk(KERN_ERR "failed to get DSS panel control GPIOs\n");
-               return;
-       }
-
-       printk(KERN_INFO "Display initialized successfully\n");
-}
-#else
-static void __init am3517_evm_display_init(void) {}
-#endif
-
-static int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev)
-{
-       if (dvi_enabled) {
-               printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
-               return -EINVAL;
-       }
-       gpio_set_value(LCD_PANEL_PWR, 1);
-       lcd_enabled = 1;
-
-       return 0;
-}
-
-static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
-{
-       gpio_set_value(LCD_PANEL_PWR, 0);
-       lcd_enabled = 0;
-}
-
 static struct panel_generic_dpi_data lcd_panel = {
        .name                   = "sharp_lq",
-       .platform_enable        = am3517_evm_panel_enable_lcd,
-       .platform_disable       = am3517_evm_panel_disable_lcd,
+       .num_gpios              = 3,
+       .gpios                  = {
+               LCD_PANEL_PWR,
+               LCD_PANEL_BKLIGHT_PWR,
+               LCD_PANEL_PWM,
+       },
 };
 
 static struct omap_dss_device am3517_evm_lcd_device = {
@@ -362,8 +313,6 @@ static void __init am3517_evm_init(void)
        omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
        usbhs_init(&usbhs_bdata);
        am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
-       /* DSS */
-       am3517_evm_display_init();
 
        /* RTC - S35390A */
        am3517_evm_rtc_init();