]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-s3c2410/mach-qt2410.c
Merge commit 'v2.6.26' into bkl-removal
[linux-2.6-omap-h63xx.git] / arch / arm / mach-s3c2410 / mach-qt2410.c
index c6a41593de21bf87e93640618db6900dabfca0b0..a1caf4b0adacd839e82edb228476e5779155d9c1 100644 (file)
@@ -27,9 +27,9 @@
 #include <linux/list.h>
 #include <linux/timer.h>
 #include <linux/init.h>
+#include <linux/sysdev.h>
 #include <linux/platform_device.h>
 #include <linux/serial_core.h>
-#include <linux/mmc/protocol.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_bitbang.h>
 
 
 #include <asm/arch/regs-gpio.h>
 #include <asm/arch/leds-gpio.h>
-#include <asm/arch/regs-serial.h>
+#include <asm/plat-s3c/regs-serial.h>
 #include <asm/arch/fb.h>
-#include <asm/arch/nand.h>
-#include <asm/arch/udc.h>
+#include <asm/plat-s3c/nand.h>
+#include <asm/plat-s3c24xx/udc.h>
 #include <asm/arch/spi.h>
 #include <asm/arch/spi-gpio.h>
 
@@ -95,157 +95,83 @@ static struct s3c2410_uartcfg smdk2410_uartcfgs[] = {
 
 /* LCD driver info */
 
-/* Configuration for 640x480 SHARP LQ080V3DG01 */
-static struct s3c2410fb_mach_info qt2410_biglcd_cfg __initdata = {
-       .regs   = {
-
-               .lcdcon1        = S3C2410_LCDCON1_TFT16BPP |
-                                 S3C2410_LCDCON1_TFT |
-                                 S3C2410_LCDCON1_CLKVAL(0x01), /* HCLK/4 */
-
-               .lcdcon2        = S3C2410_LCDCON2_VBPD(18) |    /* 19 */
-                                 S3C2410_LCDCON2_LINEVAL(479) |
-                                 S3C2410_LCDCON2_VFPD(10) |    /* 11 */
-                                 S3C2410_LCDCON2_VSPW(14),     /* 15 */
-
-               .lcdcon3        = S3C2410_LCDCON3_HBPD(43) |    /* 44 */
-                                 S3C2410_LCDCON3_HOZVAL(639) | /* 640 */
-                                 S3C2410_LCDCON3_HFPD(115),    /* 116 */
-
-               .lcdcon4        = S3C2410_LCDCON4_MVAL(0) |
-                                 S3C2410_LCDCON4_HSPW(95),     /* 96 */
-
-               .lcdcon5        = S3C2410_LCDCON5_FRM565 |
-                                 S3C2410_LCDCON5_INVVLINE |
-                                 S3C2410_LCDCON5_INVVFRAME |
-                                 S3C2410_LCDCON5_PWREN |
-                                 S3C2410_LCDCON5_HWSWP,
+static struct s3c2410fb_display qt2410_lcd_cfg[] __initdata = {
+       {
+               /* Configuration for 640x480 SHARP LQ080V3DG01 */
+               .lcdcon5 = S3C2410_LCDCON5_FRM565 |
+                          S3C2410_LCDCON5_INVVLINE |
+                          S3C2410_LCDCON5_INVVFRAME |
+                          S3C2410_LCDCON5_PWREN |
+                          S3C2410_LCDCON5_HWSWP,
+
+               .type           = S3C2410_LCDCON1_TFT,
+               .width          = 640,
+               .height         = 480,
+
+               .pixclock       = 40000, /* HCLK/4 */
+               .xres           = 640,
+               .yres           = 480,
+               .bpp            = 16,
+               .left_margin    = 44,
+               .right_margin   = 116,
+               .hsync_len      = 96,
+               .upper_margin   = 19,
+               .lower_margin   = 11,
+               .vsync_len      = 15,
        },
-
-       .lpcsel         = ((0xCE6) & ~7) | 1<<4,
-
-       .width          = 640,
-       .height         = 480,
-
-       .xres           = {
-               .min    = 640,
-               .max    = 640,
-               .defval = 640,
-       },
-
-       .yres           = {
-               .min    = 480,
-               .max    = 480,
-               .defval = 480,
+       {
+               /* Configuration for 480x640 toppoly TD028TTEC1 */
+               .lcdcon5 = S3C2410_LCDCON5_FRM565 |
+                          S3C2410_LCDCON5_INVVLINE |
+                          S3C2410_LCDCON5_INVVFRAME |
+                          S3C2410_LCDCON5_PWREN |
+                          S3C2410_LCDCON5_HWSWP,
+
+               .type           = S3C2410_LCDCON1_TFT,
+               .width          = 480,
+               .height         = 640,
+               .pixclock       = 40000, /* HCLK/4 */
+               .xres           = 480,
+               .yres           = 640,
+               .bpp            = 16,
+               .left_margin    = 8,
+               .right_margin   = 24,
+               .hsync_len      = 8,
+               .upper_margin   = 2,
+               .lower_margin   = 4,
+               .vsync_len      = 2,
        },
-
-       .bpp            = {
-               .min    = 16,
-               .max    = 16,
-               .defval = 16,
+       {
+               /* Config for 240x320 LCD */
+               .lcdcon5 = S3C2410_LCDCON5_FRM565 |
+                          S3C2410_LCDCON5_INVVLINE |
+                          S3C2410_LCDCON5_INVVFRAME |
+                          S3C2410_LCDCON5_PWREN |
+                          S3C2410_LCDCON5_HWSWP,
+
+               .type           = S3C2410_LCDCON1_TFT,
+               .width          = 240,
+               .height         = 320,
+               .pixclock       = 100000, /* HCLK/10 */
+               .xres           = 240,
+               .yres           = 320,
+               .bpp            = 16,
+               .left_margin    = 13,
+               .right_margin   = 8,
+               .hsync_len      = 4,
+               .upper_margin   = 2,
+               .lower_margin   = 7,
+               .vsync_len      = 4,
        },
 };
 
-/* Configuration for 480x640 toppoly TD028TTEC1 */
-static struct s3c2410fb_mach_info qt2410_prodlcd_cfg __initdata = {
-       .regs   = {
-
-               .lcdcon1        = S3C2410_LCDCON1_TFT16BPP |
-                                 S3C2410_LCDCON1_TFT |
-                                 S3C2410_LCDCON1_CLKVAL(0x01), /* HCLK/4 */
-
-               .lcdcon2        = S3C2410_LCDCON2_VBPD(1) |     /* 2 */
-                                 S3C2410_LCDCON2_LINEVAL(639) |/* 640 */
-                                 S3C2410_LCDCON2_VFPD(3) |     /* 4 */
-                                 S3C2410_LCDCON2_VSPW(1),      /* 2 */
 
-               .lcdcon3        = S3C2410_LCDCON3_HBPD(7) |     /* 8 */
-                                 S3C2410_LCDCON3_HOZVAL(479) | /* 479 */
-                                 S3C2410_LCDCON3_HFPD(23),     /* 24 */
-
-               .lcdcon4        = S3C2410_LCDCON4_MVAL(0) |
-                                 S3C2410_LCDCON4_HSPW(7),      /* 8 */
-
-               .lcdcon5        = S3C2410_LCDCON5_FRM565 |
-                                 S3C2410_LCDCON5_INVVLINE |
-                                 S3C2410_LCDCON5_INVVFRAME |
-                                 S3C2410_LCDCON5_PWREN |
-                                 S3C2410_LCDCON5_HWSWP,
-       },
+static struct s3c2410fb_mach_info qt2410_fb_info __initdata = {
+       .displays       = qt2410_lcd_cfg,
+       .num_displays   = ARRAY_SIZE(qt2410_lcd_cfg),
+       .default_display = 0,
 
        .lpcsel         = ((0xCE6) & ~7) | 1<<4,
-
-       .width          = 480,
-       .height         = 640,
-
-       .xres           = {
-               .min    = 480,
-               .max    = 480,
-               .defval = 480,
-       },
-
-       .yres           = {
-               .min    = 640,
-               .max    = 640,
-               .defval = 640,
-       },
-
-       .bpp            = {
-               .min    = 16,
-               .max    = 16,
-               .defval = 16,
-       },
-};
-
-/* Config for 240x320 LCD */
-static struct s3c2410fb_mach_info qt2410_lcd_cfg __initdata = {
-       .regs   = {
-
-               .lcdcon1        = S3C2410_LCDCON1_TFT16BPP |
-                                 S3C2410_LCDCON1_TFT |
-                                 S3C2410_LCDCON1_CLKVAL(0x04),
-
-               .lcdcon2        = S3C2410_LCDCON2_VBPD(1) |
-                                 S3C2410_LCDCON2_LINEVAL(319) |
-                                 S3C2410_LCDCON2_VFPD(6) |
-                                 S3C2410_LCDCON2_VSPW(3),
-
-               .lcdcon3        = S3C2410_LCDCON3_HBPD(12) |
-                                 S3C2410_LCDCON3_HOZVAL(239) |
-                                 S3C2410_LCDCON3_HFPD(7),
-
-               .lcdcon4        = S3C2410_LCDCON4_MVAL(0) |
-                                 S3C2410_LCDCON4_HSPW(3),
-
-               .lcdcon5        = S3C2410_LCDCON5_FRM565 |
-                                 S3C2410_LCDCON5_INVVLINE |
-                                 S3C2410_LCDCON5_INVVFRAME |
-                                 S3C2410_LCDCON5_PWREN |
-                                 S3C2410_LCDCON5_HWSWP,
-       },
-
-       .lpcsel         = ((0xCE6) & ~7) | 1<<4,
-
-       .width          = 240,
-       .height         = 320,
-
-       .xres           = {
-               .min    = 240,
-               .max    = 240,
-               .defval = 240,
-       },
-
-       .yres           = {
-               .min    = 320,
-               .max    = 320,
-               .defval = 320,
-       },
-
-       .bpp            = {
-               .min    = 16,
-               .max    = 16,
-               .defval = 16,
-       },
 };
 
 /* CS8900 */
@@ -331,11 +257,6 @@ static struct platform_device *qt2410_devices[] __initdata = {
        &qt2410_led,
 };
 
-static struct s3c24xx_board qt2410_board __initdata = {
-       .devices       = qt2410_devices,
-       .devices_count = ARRAY_SIZE(qt2410_devices)
-};
-
 static struct mtd_partition qt2410_nand_part[] = {
        [0] = {
                .name   = "U-Boot",
@@ -405,7 +326,6 @@ static void __init qt2410_map_io(void)
        s3c24xx_init_io(qt2410_iodesc, ARRAY_SIZE(qt2410_iodesc));
        s3c24xx_init_clocks(12*1000*1000);
        s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
-       s3c24xx_set_board(&qt2410_board);
 }
 
 static void __init qt2410_machine_init(void)
@@ -414,16 +334,17 @@ static void __init qt2410_machine_init(void)
 
        switch (tft_type) {
        case 'p': /* production */
-               s3c24xx_fb_set_platdata(&qt2410_prodlcd_cfg);
+               qt2410_fb_info.default_display = 1;
                break;
        case 'b': /* big */
-               s3c24xx_fb_set_platdata(&qt2410_biglcd_cfg);
+               qt2410_fb_info.default_display = 0;
                break;
        case 's': /* small */
        default:
-               s3c24xx_fb_set_platdata(&qt2410_lcd_cfg);
+               qt2410_fb_info.default_display = 2;
                break;
        }
+       s3c24xx_fb_set_platdata(&qt2410_fb_info);
 
        s3c2410_gpio_cfgpin(S3C2410_GPB0, S3C2410_GPIO_OUTPUT);
        s3c2410_gpio_setpin(S3C2410_GPB0, 1);
@@ -432,6 +353,7 @@ static void __init qt2410_machine_init(void)
 
        s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT);
 
+       platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices));
        s3c2410_pm_init();
 }