aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/board-sam9261ek.c
diff options
context:
space:
mode:
authorAndrew Victor <andrew@sanpeople.com>2007-11-20 03:40:12 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-01-26 10:00:30 -0500
commit5170874816fc1eb2b0b865a70b6f520268227908 (patch)
tree9dedec93933a7e666b5f00869b865ca2b8ba0488 /arch/arm/mach-at91/board-sam9261ek.c
parentb66545e7ae80b4b0eef3f7884ef9260455070be9 (diff)
[ARM] 4610/2: AT91: Support for STN LCD on SAM9261-EK board.
Add STN LCD support on the Atmel AT91SAM9261-EK board. Uses a black and white screen from Hitachi: SP06Q002. 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>
Diffstat (limited to 'arch/arm/mach-at91/board-sam9261ek.c')
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c76
1 files changed, 69 insertions, 7 deletions
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index 550ae59a3aca..594c5c100ef9 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -280,6 +280,68 @@ static struct spi_board_info ek_spi_devices[] = {
280 * LCD Controller 280 * LCD Controller
281 */ 281 */
282#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) 282#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
283
284#if defined(CONFIG_FB_ATMEL_STN)
285
286/* STN */
287static struct fb_videomode at91_stn_modes[] = {
288 {
289 .name = "SP06Q002 @ 75",
290 .refresh = 75,
291 .xres = 320, .yres = 240,
292 .pixclock = KHZ2PICOS(1440),
293
294 .left_margin = 1, .right_margin = 1,
295 .upper_margin = 0, .lower_margin = 0,
296 .hsync_len = 1, .vsync_len = 1,
297
298 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
299 .vmode = FB_VMODE_NONINTERLACED,
300 },
301};
302
303static struct fb_monspecs at91fb_default_stn_monspecs = {
304 .manufacturer = "HIT",
305 .monitor = "SP06Q002",
306
307 .modedb = at91_stn_modes,
308 .modedb_len = ARRAY_SIZE(at91_stn_modes),
309 .hfmin = 15000,
310 .hfmax = 64000,
311 .vfmin = 50,
312 .vfmax = 150,
313};
314
315#define AT91SAM9261_DEFAULT_STN_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
316 | ATMEL_LCDC_DISTYPE_STNMONO \
317 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE \
318 | ATMEL_LCDC_IFWIDTH_4 \
319 | ATMEL_LCDC_SCANMOD_SINGLE)
320
321static void at91_lcdc_stn_power_control(int on)
322{
323 /* backlight */
324 if (on) { /* power up */
325 at91_set_gpio_value(AT91_PIN_PC14, 0);
326 at91_set_gpio_value(AT91_PIN_PC15, 0);
327 } else { /* power down */
328 at91_set_gpio_value(AT91_PIN_PC14, 1);
329 at91_set_gpio_value(AT91_PIN_PC15, 1);
330 }
331}
332
333static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
334 .default_bpp = 1,
335 .default_dmacon = ATMEL_LCDC_DMAEN,
336 .default_lcdcon2 = AT91SAM9261_DEFAULT_STN_LCDCON2,
337 .default_monspecs = &at91fb_default_stn_monspecs,
338 .atmel_lcdfb_power_control = at91_lcdc_stn_power_control,
339 .guard_time = 1,
340};
341
342#else
343
344/* TFT */
283static struct fb_videomode at91_tft_vga_modes[] = { 345static struct fb_videomode at91_tft_vga_modes[] = {
284 { 346 {
285 .name = "TX09D50VM1CCA @ 60", 347 .name = "TX09D50VM1CCA @ 60",
@@ -296,7 +358,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
296 }, 358 },
297}; 359};
298 360
299static struct fb_monspecs at91fb_default_monspecs = { 361static struct fb_monspecs at91fb_default_tft_monspecs = {
300 .manufacturer = "HIT", 362 .manufacturer = "HIT",
301 .monitor = "TX09D50VM1CCA", 363 .monitor = "TX09D50VM1CCA",
302 364
@@ -308,11 +370,11 @@ static struct fb_monspecs at91fb_default_monspecs = {
308 .vfmax = 150, 370 .vfmax = 150,
309}; 371};
310 372
311#define AT91SAM9261_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \ 373#define AT91SAM9261_DEFAULT_TFT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
312 | ATMEL_LCDC_DISTYPE_TFT \ 374 | ATMEL_LCDC_DISTYPE_TFT \
313 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) 375 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
314 376
315static void at91_lcdc_power_control(int on) 377static void at91_lcdc_tft_power_control(int on)
316{ 378{
317 if (on) 379 if (on)
318 at91_set_gpio_value(AT91_PIN_PA12, 0); /* power up */ 380 at91_set_gpio_value(AT91_PIN_PA12, 0); /* power up */
@@ -320,15 +382,15 @@ static void at91_lcdc_power_control(int on)
320 at91_set_gpio_value(AT91_PIN_PA12, 1); /* power down */ 382 at91_set_gpio_value(AT91_PIN_PA12, 1); /* power down */
321} 383}
322 384
323/* Driver datas */
324static struct atmel_lcdfb_info __initdata ek_lcdc_data = { 385static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
325 .default_bpp = 16, 386 .default_bpp = 16,
326 .default_dmacon = ATMEL_LCDC_DMAEN, 387 .default_dmacon = ATMEL_LCDC_DMAEN,
327 .default_lcdcon2 = AT91SAM9261_DEFAULT_LCDCON2, 388 .default_lcdcon2 = AT91SAM9261_DEFAULT_TFT_LCDCON2,
328 .default_monspecs = &at91fb_default_monspecs, 389 .default_monspecs = &at91fb_default_tft_monspecs,
329 .atmel_lcdfb_power_control = at91_lcdc_power_control, 390 .atmel_lcdfb_power_control = at91_lcdc_tft_power_control,
330 .guard_time = 1, 391 .guard_time = 1,
331}; 392};
393#endif
332 394
333#else 395#else
334static struct atmel_lcdfb_info __initdata ek_lcdc_data; 396static struct atmel_lcdfb_info __initdata ek_lcdc_data;