summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNikita Kiryanov <[email protected]>2015-02-03 13:32:27 +0200
committerAnatolij Gustschin <[email protected]>2015-02-10 13:29:02 +0100
commit0b29a8969e918d6c09d0798d381cf74594bdf3a0 (patch)
treec25eed4c5cd29c700a12a1029a07fc44d93b91ae /drivers
parent2306457c4534d5cbadb834a2a185db3ef38e12c8 (diff)
lcd: introduce lcd_set_cmap
Reduce the lcd_display_bitmap #ifdef complexity by extracting Atmel-specific code for setting cmap for bitmap images into a new function lcd_set_cmap(). A default version is implemented with the remainder of the code. Signed-off-by: Nikita Kiryanov <[email protected]> Reviewed-by: Simon Glass <[email protected]> Tested-by: Bo Shen <[email protected]> Tested-by: Josh Wu <[email protected]> Cc: Bo Shen <[email protected]> Cc: Simon Glass <[email protected]> Cc: Anatolij Gustschin <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/atmel_lcdfb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 2a71ebae168..5add1369ef8 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -11,6 +11,7 @@
#include <asm/arch/gpio.h>
#include <asm/arch/clk.h>
#include <lcd.h>
+#include <bmp_layout.h>
#include <atmel_lcdc.h>
/* configurable parameters */
@@ -80,6 +81,16 @@ void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
#endif
}
+void lcd_set_cmap(bmp_image_t *bmp, unsigned colors)
+{
+ int i;
+
+ for (i = 0; i < colors; ++i) {
+ bmp_color_table_entry_t cte = bmp->color_table[i];
+ lcd_setcolreg(i, cte.red, cte.green, cte.blue);
+ }
+}
+
void lcd_ctrl_init(void *lcdbase)
{
unsigned long value;