]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] 4379/1: AT91: LCD support on SAM9261-EK and SAM9263-EK boards
authorAndrew Victor <andrew@sanpeople.com>
Mon, 14 May 2007 14:08:21 +0000 (15:08 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 12 Jul 2007 10:11:21 +0000 (11:11 +0100)
Add board-specific setup for the LCD on the Atmel AT91SAM9261-EK and
AT91SAM9263-EK boards.

Signed-off-by: Nicolas Ferre <nicolas.ferre@rfo.atmel.com>
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-at91/board-sam9261ek.c
arch/arm/mach-at91/board-sam9263ek.c

index 26ca8ab3f62a7dc3df8f620178cf2695614ce44e..579b41f0c328aa3cff6d1c5933b93e8d2145f9f1 100644 (file)
@@ -27,6 +27,9 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
 #include <linux/dm9000.h>
+#include <linux/fb.h>
+
+#include <video/atmel_lcdc.h>
 
 #include <asm/hardware.h>
 #include <asm/setup.h>
@@ -271,6 +274,65 @@ static struct spi_board_info ek_spi_devices[] = {
 };
 
 
+/*
+ * LCD Controller
+ */
+#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
+static struct fb_videomode at91_tft_vga_modes[] = {
+       {
+               .name           = "TX09D50VM1CCA @ 60",
+               .refresh        = 60,
+               .xres           = 240,          .yres           = 320,
+               .pixclock       = KHZ2PICOS(4965),
+
+               .left_margin    = 1,            .right_margin   = 33,
+               .upper_margin   = 1,            .lower_margin   = 0,
+               .hsync_len      = 5,            .vsync_len      = 1,
+
+               .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+               .vmode          = FB_VMODE_NONINTERLACED,
+       },
+};
+
+static struct fb_monspecs at91fb_default_monspecs = {
+       .manufacturer   = "HIT",
+       .monitor        = "TX09D50VM1CCA",
+
+       .modedb         = at91_tft_vga_modes,
+       .modedb_len     = ARRAY_SIZE(at91_tft_vga_modes),
+       .hfmin          = 15000,
+       .hfmax          = 64000,
+       .vfmin          = 50,
+       .vfmax          = 150,
+};
+
+#define AT91SAM9261_DEFAULT_LCDCON2    (ATMEL_LCDC_MEMOR_LITTLE \
+                                       | ATMEL_LCDC_DISTYPE_TFT    \
+                                       | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
+
+static void at91_lcdc_power_control(int on)
+{
+       if (on)
+               at91_set_gpio_value(AT91_PIN_PA12, 0);  /* power up */
+       else
+               at91_set_gpio_value(AT91_PIN_PA12, 1);  /* power down */
+}
+
+/* Driver datas */
+static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
+       .default_bpp                    = 16,
+       .default_dmacon                 = ATMEL_LCDC_DMAEN,
+       .default_lcdcon2                = AT91SAM9261_DEFAULT_LCDCON2,
+       .default_monspecs               = &at91fb_default_monspecs,
+       .atmel_lcdfb_power_control      = at91_lcdc_power_control,
+       .guard_time                     = 1,
+};
+
+#else
+static struct atmel_lcdfb_info __initdata ek_lcdc_data;
+#endif
+
+
 static void __init ek_board_init(void)
 {
        /* Serial */
@@ -296,6 +358,8 @@ static void __init ek_board_init(void)
        /* MMC */
        at91_add_device_mmc(0, &ek_mmc_data);
 #endif
+       /* LCD Controller */
+       at91_add_device_lcdc(&ek_lcdc_data);
 }
 
 MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
index c164c8e58ae6a037cdfbbf4b9b5a9842b9b094e2..2a1cc73390b79cd88943d7718c3fd3454d3c65fa 100644 (file)
@@ -26,6 +26,9 @@
 #include <linux/platform_device.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
+#include <linux/fb.h>
+
+#include <video/atmel_lcdc.h>
 
 #include <asm/hardware.h>
 #include <asm/setup.h>
@@ -201,6 +204,65 @@ static struct at91_nand_data __initdata ek_nand_data = {
 };
 
 
+/*
+ * LCD Controller
+ */
+#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
+static struct fb_videomode at91_tft_vga_modes[] = {
+       {
+               .name           = "TX09D50VM1CCA @ 60",
+               .refresh        = 60,
+               .xres           = 240,          .yres           = 320,
+               .pixclock       = KHZ2PICOS(4965),
+
+               .left_margin    = 1,            .right_margin   = 33,
+               .upper_margin   = 1,            .lower_margin   = 0,
+               .hsync_len      = 5,            .vsync_len      = 1,
+
+               .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+               .vmode          = FB_VMODE_NONINTERLACED,
+       },
+};
+
+static struct fb_monspecs at91fb_default_monspecs = {
+       .manufacturer   = "HIT",
+       .monitor        = "TX09D70VM1CCA",
+
+       .modedb         = at91_tft_vga_modes,
+       .modedb_len     = ARRAY_SIZE(at91_tft_vga_modes),
+       .hfmin          = 15000,
+       .hfmax          = 64000,
+       .vfmin          = 50,
+       .vfmax          = 150,
+};
+
+#define AT91SAM9263_DEFAULT_LCDCON2    (ATMEL_LCDC_MEMOR_LITTLE \
+                                       | ATMEL_LCDC_DISTYPE_TFT    \
+                                       | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
+
+static void at91_lcdc_power_control(int on)
+{
+       if (on)
+               at91_set_gpio_value(AT91_PIN_PD12, 0);  /* power up */
+       else
+               at91_set_gpio_value(AT91_PIN_PD12, 1);  /* power down */
+}
+
+/* Driver datas */
+static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
+       .default_bpp                    = 16,
+       .default_dmacon                 = ATMEL_LCDC_DMAEN,
+       .default_lcdcon2                = AT91SAM9263_DEFAULT_LCDCON2,
+       .default_monspecs               = &at91fb_default_monspecs,
+       .atmel_lcdfb_power_control      = at91_lcdc_power_control,
+       .guard_time                     = 1,
+};
+
+#else
+static struct atmel_lcdfb_info __initdata ek_lcdc_data;
+#endif
+
+
 /*
  * AC97
  */
@@ -230,6 +292,8 @@ static void __init ek_board_init(void)
        at91_add_device_nand(&ek_nand_data);
        /* I2C */
        at91_add_device_i2c();
+       /* LCD Controller */
+       at91_add_device_lcdc(&ek_lcdc_data);
        /* AC97 */
        at91_add_device_ac97(&ek_ac97_data);
 }