aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/boards/atngw100/evklcd10x.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/avr32/boards/atngw100/evklcd10x.c')
-rw-r--r--arch/avr32/boards/atngw100/evklcd10x.c50
1 files changed, 34 insertions, 16 deletions
diff --git a/arch/avr32/boards/atngw100/evklcd10x.c b/arch/avr32/boards/atngw100/evklcd10x.c
index 8140b22b3461..00337112c5ac 100644
--- a/arch/avr32/boards/atngw100/evklcd10x.c
+++ b/arch/avr32/boards/atngw100/evklcd10x.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <linux/gpio.h>
14#include <linux/fb.h> 15#include <linux/fb.h>
15#include <linux/platform_device.h> 16#include <linux/platform_device.h>
16 17
@@ -19,26 +20,26 @@
19#include <asm/setup.h> 20#include <asm/setup.h>
20 21
21#include <mach/at32ap700x.h> 22#include <mach/at32ap700x.h>
23#include <mach/portmux.h>
22#include <mach/board.h> 24#include <mach/board.h>
23 25
26#include <sound/atmel-ac97c.h>
27
24static struct ac97c_platform_data __initdata ac97c0_data = { 28static struct ac97c_platform_data __initdata ac97c0_data = {
25 .dma_rx_periph_id = 3, 29 .reset_pin = GPIO_PIN_PB(19),
26 .dma_tx_periph_id = 4,
27 .dma_controller_id = 0,
28 .reset_pin = GPIO_PIN_PB(19),
29}; 30};
30 31
31#ifdef CONFIG_BOARD_ATNGW100_EVKLCD10X_VGA 32#ifdef CONFIG_BOARD_ATNGW100_EVKLCD10X_VGA
32static struct fb_videomode __initdata tcg057vglad_modes[] = { 33static struct fb_videomode __initdata tcg057vglad_modes[] = {
33 { 34 {
34 .name = "640x480 @ 60", 35 .name = "640x480 @ 50",
35 .refresh = 60, 36 .refresh = 50,
36 .xres = 640, .yres = 480, 37 .xres = 640, .yres = 480,
37 .pixclock = KHZ2PICOS(25180), 38 .pixclock = KHZ2PICOS(25180),
38 39
39 .left_margin = 64, .right_margin = 31, 40 .left_margin = 64, .right_margin = 96,
40 .upper_margin = 34, .lower_margin = 2, 41 .upper_margin = 34, .lower_margin = 11,
41 .hsync_len = 96, .vsync_len = 4, 42 .hsync_len = 64, .vsync_len = 15,
42 43
43 .sync = 0, 44 .sync = 0,
44 .vmode = FB_VMODE_NONINTERLACED, 45 .vmode = FB_VMODE_NONINTERLACED,
@@ -69,14 +70,14 @@ static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = {
69#elif CONFIG_BOARD_ATNGW100_EVKLCD10X_QVGA 70#elif CONFIG_BOARD_ATNGW100_EVKLCD10X_QVGA
70static struct fb_videomode __initdata tcg057qvlad_modes[] = { 71static struct fb_videomode __initdata tcg057qvlad_modes[] = {
71 { 72 {
72 .name = "320x240 @ 60", 73 .name = "320x240 @ 50",
73 .refresh = 60, 74 .refresh = 50,
74 .xres = 320, .yres = 240, 75 .xres = 320, .yres = 240,
75 .pixclock = KHZ2PICOS(6300), 76 .pixclock = KHZ2PICOS(6300),
76 77
77 .left_margin = 52, .right_margin = 28, 78 .left_margin = 34, .right_margin = 46,
78 .upper_margin = 7, .lower_margin = 2, 79 .upper_margin = 7, .lower_margin = 15,
79 .hsync_len = 96, .vsync_len = 4, 80 .hsync_len = 64, .vsync_len = 12,
80 81
81 .sync = 0, 82 .sync = 0,
82 .vmode = FB_VMODE_NONINTERLACED, 83 .vmode = FB_VMODE_NONINTERLACED,
@@ -144,12 +145,29 @@ static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = {
144}; 145};
145#endif 146#endif
146 147
148static void atevklcd10x_lcdc_power_control(int on)
149{
150 gpio_set_value(GPIO_PIN_PB(15), on);
151}
152
147static int __init atevklcd10x_init(void) 153static int __init atevklcd10x_init(void)
148{ 154{
149 at32_add_device_ac97c(0, &ac97c0_data); 155 /* PB15 is connected to the enable line on the boost regulator
156 * controlling the backlight for the LCD panel.
157 */
158 at32_select_gpio(GPIO_PIN_PB(15), AT32_GPIOF_OUTPUT);
159 gpio_request(GPIO_PIN_PB(15), "backlight");
160 gpio_direction_output(GPIO_PIN_PB(15), 0);
161
162 atevklcd10x_lcdc_data.atmel_lcdfb_power_control =
163 atevklcd10x_lcdc_power_control;
150 164
151 at32_add_device_lcdc(0, &atevklcd10x_lcdc_data, 165 at32_add_device_lcdc(0, &atevklcd10x_lcdc_data,
152 fbmem_start, fbmem_size, 1); 166 fbmem_start, fbmem_size,
167 ATMEL_LCDC_ALT_18BIT | ATMEL_LCDC_PE_DVAL);
168
169 at32_add_device_ac97c(0, &ac97c0_data, AC97C_BOTH);
170
153 return 0; 171 return 0;
154} 172}
155postcore_initcall(atevklcd10x_init); 173postcore_initcall(atevklcd10x_init);