]> Pileus Git - ~andy/linux/blobdiff - arch/arm/mach-omap2/board-cm-t35.c
Merge branch 'late/clksrc' into late/cleanup
[~andy/linux] / arch / arm / mach-omap2 / board-cm-t35.c
index 7fda3f5f8a7fdf8ce0de057241342333729a8fc8..ee6218c74807007d5d0eb8bf86dc92dfac3a5a3a 100644 (file)
@@ -41,8 +41,7 @@
 
 #include <linux/platform_data/mtd-nand-omap2.h>
 #include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
-#include <video/omap-panel-tfp410.h>
+#include <video/omap-panel-data.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
 #include "common.h"
@@ -191,45 +190,12 @@ static inline void cm_t35_init_nand(void) {}
 #define CM_T35_LCD_BL_GPIO 58
 #define CM_T35_DVI_EN_GPIO 54
 
-static int lcd_enabled;
-static int dvi_enabled;
-
-static int cm_t35_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(CM_T35_LCD_EN_GPIO, 1);
-       gpio_set_value(CM_T35_LCD_BL_GPIO, 1);
-
-       lcd_enabled = 1;
-
-       return 0;
-}
-
-static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev)
-{
-       lcd_enabled = 0;
-
-       gpio_set_value(CM_T35_LCD_BL_GPIO, 0);
-       gpio_set_value(CM_T35_LCD_EN_GPIO, 0);
-}
-
-static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev)
-{
-       return 0;
-}
-
-static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev)
-{
-}
-
 static struct panel_generic_dpi_data lcd_panel = {
        .name                   = "toppoly_tdo35s",
-       .platform_enable        = cm_t35_panel_enable_lcd,
-       .platform_disable       = cm_t35_panel_disable_lcd,
+       .num_gpios              = 1,
+       .gpios                  = {
+               CM_T35_LCD_BL_GPIO,
+       },
 };
 
 static struct omap_dss_device cm_t35_lcd_device = {
@@ -258,8 +224,6 @@ static struct omap_dss_device cm_t35_tv_device = {
        .driver_name            = "venc",
        .type                   = OMAP_DISPLAY_TYPE_VENC,
        .phy.venc.type          = OMAP_DSS_VENC_TYPE_SVIDEO,
-       .platform_enable        = cm_t35_panel_enable_tv,
-       .platform_disable       = cm_t35_panel_disable_tv,
 };
 
 static struct omap_dss_device *cm_t35_dss_devices[] = {
@@ -293,11 +257,6 @@ static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = {
        },
 };
 
-static struct gpio cm_t35_dss_gpios[] __initdata = {
-       { CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW,  "lcd enable"    },
-       { CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW,  "lcd bl enable" },
-};
-
 static void __init cm_t35_init_display(void)
 {
        int err;
@@ -305,23 +264,21 @@ static void __init cm_t35_init_display(void)
        spi_register_board_info(cm_t35_lcd_spi_board_info,
                                ARRAY_SIZE(cm_t35_lcd_spi_board_info));
 
-       err = gpio_request_array(cm_t35_dss_gpios,
-                                ARRAY_SIZE(cm_t35_dss_gpios));
+
+       err = gpio_request_one(CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW,
+                       "lcd bl enable");
        if (err) {
-               pr_err("CM-T35: failed to request DSS control GPIOs\n");
+               pr_err("CM-T35: failed to request LCD EN GPIO\n");
                return;
        }
 
-       gpio_export(CM_T35_LCD_EN_GPIO, 0);
-       gpio_export(CM_T35_LCD_BL_GPIO, 0);
-
        msleep(50);
        gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
 
        err = omap_display_init(&cm_t35_dss_data);
        if (err) {
                pr_err("CM-T35: failed to register DSS device\n");
-               gpio_free_array(cm_t35_dss_gpios, ARRAY_SIZE(cm_t35_dss_gpios));
+               gpio_free(CM_T35_LCD_EN_GPIO);
        }
 }