From fd0858017eb67aa0d41dd4e8499ca6a7bfb63941 Mon Sep 17 00:00:00 2001 From: Nicolas Ferre Date: Mon, 28 Apr 2008 02:15:21 -0700 Subject: 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 Cc: David Brownell Cc: Hans-Christian Egtvedt Cc: Haavard Skinnemoen Cc: Andrew Victor Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/video/atmel_lcdc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h index 2fd9fad922e..ed64862c4e1 100644 --- a/include/video/atmel_lcdc.h +++ b/include/video/atmel_lcdc.h @@ -22,6 +22,15 @@ #ifndef __ATMEL_LCDC_H__ #define __ATMEL_LCDC_H__ + +/* Way LCD wires are connected to the chip: + * Some Atmel chips use BGR color mode (instead of standard RGB) + * A swapped wiring onboard can bring to RGB mode. + */ +#define ATMEL_LCDC_WIRING_BGR 0 +#define ATMEL_LCDC_WIRING_RGB 1 + + /* LCD Controller info data structure, stored in device platform_data */ struct atmel_lcdfb_info { spinlock_t lock; @@ -42,6 +51,7 @@ struct atmel_lcdfb_info { u8 saved_lcdcon; u8 default_bpp; + u8 lcd_wiring_mode; unsigned int default_lcdcon2; unsigned int default_dmacon; void (*atmel_lcdfb_power_control)(int on); -- cgit v1.2.3