diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2008-04-28 05:15:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:39 -0400 |
commit | fd0858017eb67aa0d41dd4e8499ca6a7bfb63941 (patch) | |
tree | 782b525181b6cd2f10b4f1307e93a8716c783dd4 /drivers/video | |
parent | cf19a37e0641d975d271a5a30f097dd6b96d232f (diff) |
atmel_lcdfb: wiring BGR to RGB color mode
Adds different wiring mode for the LCD screen.
The legacy atmel LCDC IP uses a non standard color mode, "BGR-555.1" instead
"RGB-565". The major part of graphic stacks for embedded systems uses only
"RGB-565". It is possible to swap LCD IOs instead of doing this bit swapping
by software (See application note AT91SAM9 LCD Controller
http://www.atmel.com/dyn/resources/prod_documents/doc6300.pdf)
This wire swapping is done on the at91sam9rl-ek board (board code
using this patch will come later).
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Andrew Victor <avictor.za@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/atmel_lcdfb.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 6fcf76c12910..5a31a7a40cd4 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
@@ -338,19 +338,35 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, | |||
338 | break; | 338 | break; |
339 | case 15: | 339 | case 15: |
340 | case 16: | 340 | case 16: |
341 | var->red.offset = 0; | 341 | if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) { |
342 | /* RGB:565 mode */ | ||
343 | var->red.offset = 11; | ||
344 | var->blue.offset = 0; | ||
345 | var->green.length = 6; | ||
346 | } else { | ||
347 | /* BGR:555 mode */ | ||
348 | var->red.offset = 0; | ||
349 | var->blue.offset = 10; | ||
350 | var->green.length = 5; | ||
351 | } | ||
342 | var->green.offset = 5; | 352 | var->green.offset = 5; |
343 | var->blue.offset = 10; | 353 | var->red.length = var->blue.length = 5; |
344 | var->red.length = var->green.length = var->blue.length = 5; | ||
345 | break; | 354 | break; |
346 | case 32: | 355 | case 32: |
347 | var->transp.offset = 24; | 356 | var->transp.offset = 24; |
348 | var->transp.length = 8; | 357 | var->transp.length = 8; |
349 | /* fall through */ | 358 | /* fall through */ |
350 | case 24: | 359 | case 24: |
351 | var->red.offset = 0; | 360 | if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) { |
361 | /* RGB:888 mode */ | ||
362 | var->red.offset = 16; | ||
363 | var->blue.offset = 0; | ||
364 | } else { | ||
365 | /* BGR:888 mode */ | ||
366 | var->red.offset = 0; | ||
367 | var->blue.offset = 16; | ||
368 | } | ||
352 | var->green.offset = 8; | 369 | var->green.offset = 8; |
353 | var->blue.offset = 16; | ||
354 | var->red.length = var->green.length = var->blue.length = 8; | 370 | var->red.length = var->green.length = var->blue.length = 8; |
355 | break; | 371 | break; |
356 | default: | 372 | default: |
@@ -697,6 +713,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) | |||
697 | sinfo->atmel_lcdfb_power_control = pdata_sinfo->atmel_lcdfb_power_control; | 713 | sinfo->atmel_lcdfb_power_control = pdata_sinfo->atmel_lcdfb_power_control; |
698 | sinfo->guard_time = pdata_sinfo->guard_time; | 714 | sinfo->guard_time = pdata_sinfo->guard_time; |
699 | sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight; | 715 | sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight; |
716 | sinfo->lcd_wiring_mode = pdata_sinfo->lcd_wiring_mode; | ||
700 | } else { | 717 | } else { |
701 | dev_err(dev, "cannot get default configuration\n"); | 718 | dev_err(dev, "cannot get default configuration\n"); |
702 | goto free_info; | 719 | goto free_info; |