]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP3: framebuffer support for 3430SDP
authorKevin Hilman <khilman@mvista.com>
Tue, 11 Dec 2007 17:02:56 +0000 (09:02 -0800)
committerTony Lindgren <tony@atomide.com>
Mon, 17 Dec 2007 18:33:37 +0000 (10:33 -0800)
The 3430SDP uses the same panel as the 2430SDP.  The main difference
are in the GPIO lines used for panel enable and backlight, and the
VAUX register/commands sent to the TWL4030 power subsystem.

Also, some misc. whitespace cleanups.

Signed-off-by: Kevin Hilman <khilman@mvsita.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-3430sdp.c
drivers/video/omap/Makefile
drivers/video/omap/lcd_2430sdp.c

index 55691b52e0fd42e57aca914343c367e4b9540264..ba410bfe13772eca6b722580c12d53bcce2d7279 100644 (file)
@@ -254,10 +254,17 @@ static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
                .platform_data          = &tsc2046_config,
        },
 };
+
+static struct platform_device sdp3430_lcd_device = {
+       .name           = "sdp2430_lcd",
+       .id             = -1,
+};
+
 static struct platform_device *sdp3430_devices[] __initdata = {
        &sdp3430_smc91x_device,
        &sdp3430_flash_device,
        &sdp3430_kp_device,
+       &sdp3430_lcd_device,
 };
 
 static inline void __init sdp3430_init_smc91x(void)
@@ -296,9 +303,15 @@ static struct omap_uart_config sdp3430_uart_config __initdata = {
        .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
 };
 
+static struct omap_lcd_config sdp3430_lcd_config __initdata = {
+       .ctrl_name      = "internal",
+};
+
 static struct omap_board_config_kernel sdp3430_config[] = {
        { OMAP_TAG_UART,        &sdp3430_uart_config },
+       {OMAP_TAG_LCD,          &sdp3430_lcd_config},
 };
+
 static int __init omap3430_i2c_init(void)
 {
        omap_register_i2c_bus(1, 2600, NULL, 0);
index 9211128bf47d15133cd18288e16b67d97bacb108..fb6cb15abaee9ab86f41a2f26aa5eb6005fad24c 100644 (file)
@@ -8,6 +8,7 @@ objs-yy := omapfb_main.o
 
 objs-y$(CONFIG_ARCH_OMAP1) += lcdc.o
 objs-y$(CONFIG_ARCH_OMAP2) += dispc.o
+objs-y$(CONFIG_ARCH_OMAP3) += dispc.o
 
 objs-$(CONFIG_ARCH_OMAP1)$(CONFIG_FB_OMAP_LCDC_EXTERNAL) += sossi.o
 objs-$(CONFIG_ARCH_OMAP2)$(CONFIG_FB_OMAP_LCDC_EXTERNAL) += rfbi.o
@@ -29,6 +30,7 @@ objs-y$(CONFIG_MACH_SX1) += lcd_sx1.o
 
 objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o
 objs-y$(CONFIG_MACH_OMAP_2430SDP) += lcd_2430sdp.o
+objs-y$(CONFIG_MACH_OMAP_3430SDP) += lcd_2430sdp.o
 objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o
 
 omapfb-objs := $(objs-yy)
index a252d828ce8e1db3c30797610cd7712474b1a54f..2464e857072b36f2ddd202c28326c2458f207536 100644 (file)
 #include <asm/arch/mux.h>
 #include <asm/arch/omapfb.h>
 #include <asm/arch/twl4030.h>
+#include <asm/mach-types.h>
+
+#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO       91
+#define SDP2430_LCD_PANEL_ENABLE_GPIO          154
+#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO       24
+#define SDP3430_LCD_PANEL_ENABLE_GPIO          28
+
+static unsigned backlight_gpio;
+static unsigned enable_gpio;
 
-#define LCD_PANEL_BACKLIGHT_GPIO       91
-#define LCD_PANEL_ENABLE_GPIO          154
 #define LCD_PIXCLOCK_MAX               5400 /* freq 5.4 MHz */
 #define PM_RECEIVER             TWL4030_MODULE_PM_RECEIVER
 #define ENABLE_VAUX2_DEDICATED  0x09
 #define ENABLE_VAUX2_DEV_GRP    0x20
+#define ENABLE_VAUX3_DEDICATED 0x03
+#define ENABLE_VAUX3_DEV_GRP   0x20
 
 
 #define t2_out(c, r, v) twl4030_i2c_write_u8(c, r, v)
 static int sdp2430_panel_init(struct lcd_panel *panel,
                                struct omapfb_device *fbdev)
 {
-       omap_request_gpio(LCD_PANEL_ENABLE_GPIO);       /* LCD panel */
-       omap_request_gpio(LCD_PANEL_BACKLIGHT_GPIO);    /* LCD backlight */
-       omap_set_gpio_direction(LCD_PANEL_ENABLE_GPIO, 0);      /* output */
-       omap_set_gpio_direction(LCD_PANEL_BACKLIGHT_GPIO, 0);   /* output */
+       if (machine_is_omap_3430sdp()) {
+               enable_gpio    = SDP3430_LCD_PANEL_ENABLE_GPIO;
+               backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO;
+       } else {
+               enable_gpio    = SDP2430_LCD_PANEL_ENABLE_GPIO;
+               backlight_gpio = SDP2430_LCD_PANEL_BACKLIGHT_GPIO;
+       }
+
+       omap_request_gpio(enable_gpio);                 /* LCD panel */
+       omap_request_gpio(backlight_gpio);              /* LCD backlight */
+       omap_set_gpio_direction(enable_gpio, 0);        /* output */
+       omap_set_gpio_direction(backlight_gpio, 0);     /* output */
 
        return 0;
 }
@@ -57,21 +74,36 @@ static void sdp2430_panel_cleanup(struct lcd_panel *panel)
 
 static int sdp2430_panel_enable(struct lcd_panel *panel)
 {
-       omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 1);
-       omap_set_gpio_dataout(LCD_PANEL_BACKLIGHT_GPIO, 1);
-
-       if(0!= t2_out(PM_RECEIVER, ENABLE_VAUX2_DEDICATED,
-                      TWL4030_VAUX2_DEDICATED)) return -EIO;
-       if(0!= t2_out(PM_RECEIVER, ENABLE_VAUX2_DEV_GRP,
-                      TWL4030_VAUX2_DEV_GRP)) return -EIO;
+       u8 ded_val, ded_reg;
+       u8 grp_val, grp_reg;
+
+       if (machine_is_omap_3430sdp()) {
+               ded_reg = TWL4030_VAUX3_DEDICATED;
+               ded_val = ENABLE_VAUX3_DEDICATED;
+               grp_reg = TWL4030_VAUX3_DEV_GRP;
+               grp_val = ENABLE_VAUX3_DEV_GRP;
+       } else {
+               ded_reg = TWL4030_VAUX2_DEDICATED;
+               ded_val = ENABLE_VAUX2_DEDICATED;
+               grp_reg = TWL4030_VAUX2_DEV_GRP;
+               grp_val = ENABLE_VAUX2_DEV_GRP;
+       }
+               
+       omap_set_gpio_dataout(enable_gpio, 1);
+       omap_set_gpio_dataout(backlight_gpio, 1);
+
+       if (0 != t2_out(PM_RECEIVER, ded_val, ded_reg))
+               return -EIO;
+       if (0 != t2_out(PM_RECEIVER, grp_val, grp_reg))
+               return -EIO;
 
        return 0;
 }
 
 static void sdp2430_panel_disable(struct lcd_panel *panel)
 {
-       omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 0);
-        omap_set_gpio_dataout(LCD_PANEL_BACKLIGHT_GPIO, 0);
+       omap_set_gpio_dataout(enable_gpio, 0);
+       omap_set_gpio_dataout(backlight_gpio, 0);
 }
 
 static unsigned long sdp2430_panel_get_caps(struct lcd_panel *panel)
@@ -99,7 +131,7 @@ struct lcd_panel sdp2430_panel = {
 
        .init           = sdp2430_panel_init,
        .cleanup        = sdp2430_panel_cleanup,
-       .enable = sdp2430_panel_enable,
+       .enable         = sdp2430_panel_enable,
        .disable        = sdp2430_panel_disable,
        .get_caps       = sdp2430_panel_get_caps,
 };
@@ -128,7 +160,7 @@ static int sdp2430_panel_resume(struct platform_device *pdev)
 struct platform_driver sdp2430_panel_driver = {
        .probe          = sdp2430_panel_probe,
        .remove         = sdp2430_panel_remove,
-       .suspend                = sdp2430_panel_suspend,
+       .suspend        = sdp2430_panel_suspend,
        .resume         = sdp2430_panel_resume,
        .driver         = {
                .name   = "sdp2430_lcd",