diff options
Diffstat (limited to 'arch/arm/mach-at91/board-sam9261ek.c')
-rw-r--r-- | arch/arm/mach-at91/board-sam9261ek.c | 84 |
1 files changed, 73 insertions, 11 deletions
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 550ae59a3aca..aa29ea58ca09 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 */ | ||
287 | static 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 | |||
303 | static 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 | |||
321 | static 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 | |||
333 | static 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 */ | ||
283 | static struct fb_videomode at91_tft_vga_modes[] = { | 345 | static 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 | ||
299 | static struct fb_monspecs at91fb_default_monspecs = { | 361 | static 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 | ||
315 | static void at91_lcdc_power_control(int on) | 377 | static 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 */ | ||
324 | static struct atmel_lcdfb_info __initdata ek_lcdc_data = { | 385 | static 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 |
334 | static struct atmel_lcdfb_info __initdata ek_lcdc_data; | 396 | static struct atmel_lcdfb_info __initdata ek_lcdc_data; |
@@ -342,25 +404,25 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data; | |||
342 | static struct gpio_keys_button ek_buttons[] = { | 404 | static struct gpio_keys_button ek_buttons[] = { |
343 | { | 405 | { |
344 | .gpio = AT91_PIN_PA27, | 406 | .gpio = AT91_PIN_PA27, |
345 | .keycode = BTN_0, | 407 | .code = BTN_0, |
346 | .desc = "Button 0", | 408 | .desc = "Button 0", |
347 | .active_low = 1, | 409 | .active_low = 1, |
348 | }, | 410 | }, |
349 | { | 411 | { |
350 | .gpio = AT91_PIN_PA26, | 412 | .gpio = AT91_PIN_PA26, |
351 | .keycode = BTN_1, | 413 | .code = BTN_1, |
352 | .desc = "Button 1", | 414 | .desc = "Button 1", |
353 | .active_low = 1, | 415 | .active_low = 1, |
354 | }, | 416 | }, |
355 | { | 417 | { |
356 | .gpio = AT91_PIN_PA25, | 418 | .gpio = AT91_PIN_PA25, |
357 | .keycode = BTN_2, | 419 | .code = BTN_2, |
358 | .desc = "Button 2", | 420 | .desc = "Button 2", |
359 | .active_low = 1, | 421 | .active_low = 1, |
360 | }, | 422 | }, |
361 | { | 423 | { |
362 | .gpio = AT91_PIN_PA24, | 424 | .gpio = AT91_PIN_PA24, |
363 | .keycode = BTN_3, | 425 | .code = BTN_3, |
364 | .desc = "Button 3", | 426 | .desc = "Button 3", |
365 | .active_low = 1, | 427 | .active_low = 1, |
366 | } | 428 | } |