2 * Board-specific setup code for the ATEVKLCD10X addon board to the ATNGW100
5 * Copyright (C) 2008 Atmel Corporation
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
12 #include <linux/init.h>
13 #include <linux/linkage.h>
15 #include <linux/platform_device.h>
17 #include <video/atmel_lcdc.h>
19 #include <asm/setup.h>
21 #include <mach/at32ap700x.h>
22 #include <mach/board.h>
24 static struct ac97c_platform_data __initdata ac97c0_data
= {
25 .dma_rx_periph_id
= 3,
26 .dma_tx_periph_id
= 4,
27 .dma_controller_id
= 0,
28 .reset_pin
= GPIO_PIN_PB(19),
31 #ifdef CONFIG_BOARD_ATNGW100_EVKLCD10X_VGA
32 static struct fb_videomode __initdata tcg057vglad_modes
[] = {
34 .name
= "640x480 @ 60",
36 .xres
= 640, .yres
= 480,
37 .pixclock
= KHZ2PICOS(25180),
39 .left_margin
= 64, .right_margin
= 31,
40 .upper_margin
= 34, .lower_margin
= 2,
41 .hsync_len
= 96, .vsync_len
= 4,
44 .vmode
= FB_VMODE_NONINTERLACED
,
48 static struct fb_monspecs __initdata atevklcd10x_default_monspecs
= {
49 .manufacturer
= "KYO",
50 .monitor
= "TCG057VGLAD",
51 .modedb
= tcg057vglad_modes
,
52 .modedb_len
= ARRAY_SIZE(tcg057vglad_modes
),
60 static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data
= {
62 .default_dmacon
= ATMEL_LCDC_DMAEN
| ATMEL_LCDC_DMA2DEN
,
63 .default_lcdcon2
= (ATMEL_LCDC_DISTYPE_TFT
64 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
65 | ATMEL_LCDC_MEMOR_BIG
),
66 .default_monspecs
= &atevklcd10x_default_monspecs
,
69 #elif CONFIG_BOARD_ATNGW100_EVKLCD10X_QVGA
70 static struct fb_videomode __initdata tcg057qvlad_modes
[] = {
72 .name
= "320x240 @ 60",
74 .xres
= 320, .yres
= 240,
75 .pixclock
= KHZ2PICOS(6300),
77 .left_margin
= 52, .right_margin
= 28,
78 .upper_margin
= 7, .lower_margin
= 2,
79 .hsync_len
= 96, .vsync_len
= 4,
82 .vmode
= FB_VMODE_NONINTERLACED
,
86 static struct fb_monspecs __initdata atevklcd10x_default_monspecs
= {
87 .manufacturer
= "KYO",
88 .monitor
= "TCG057QVLAD",
89 .modedb
= tcg057qvlad_modes
,
90 .modedb_len
= ARRAY_SIZE(tcg057qvlad_modes
),
98 static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data
= {
100 .default_dmacon
= ATMEL_LCDC_DMAEN
| ATMEL_LCDC_DMA2DEN
,
101 .default_lcdcon2
= (ATMEL_LCDC_DISTYPE_TFT
102 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
103 | ATMEL_LCDC_MEMOR_BIG
),
104 .default_monspecs
= &atevklcd10x_default_monspecs
,
107 #elif CONFIG_BOARD_ATNGW100_EVKLCD10X_POW_QVGA
108 static struct fb_videomode __initdata ph320240t_modes
[] = {
110 .name
= "320x240 @ 60",
112 .xres
= 320, .yres
= 240,
113 .pixclock
= KHZ2PICOS(6300),
115 .left_margin
= 38, .right_margin
= 20,
116 .upper_margin
= 15, .lower_margin
= 5,
117 .hsync_len
= 30, .vsync_len
= 3,
120 .vmode
= FB_VMODE_NONINTERLACED
,
124 static struct fb_monspecs __initdata atevklcd10x_default_monspecs
= {
125 .manufacturer
= "POW",
126 .monitor
= "PH320240T",
127 .modedb
= ph320240t_modes
,
128 .modedb_len
= ARRAY_SIZE(ph320240t_modes
),
136 static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data
= {
138 .default_dmacon
= ATMEL_LCDC_DMAEN
| ATMEL_LCDC_DMA2DEN
,
139 .default_lcdcon2
= (ATMEL_LCDC_DISTYPE_TFT
140 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
141 | ATMEL_LCDC_MEMOR_BIG
),
142 .default_monspecs
= &atevklcd10x_default_monspecs
,
147 static int __init
atevklcd10x_init(void)
149 at32_add_device_ac97c(0, &ac97c0_data
);
151 at32_add_device_lcdc(0, &atevklcd10x_lcdc_data
,
152 fbmem_start
, fbmem_size
, 1);
155 postcore_initcall(atevklcd10x_init
);