summaryrefslogtreecommitdiff
path: root/drivers/video/mpc8xx_lcd.c
diff options
context:
space:
mode:
authorNikita Kiryanov <nikita@compulab.co.il>2015-02-03 13:32:25 +0200
committerAnatolij Gustschin <agust@denx.de>2015-02-10 13:27:58 +0100
commit0ee261f6d3f387a33687bff29342e9321e2f8194 (patch)
tree20eff4030906462a43383727e0d5171a90f921ee /drivers/video/mpc8xx_lcd.c
parenta02e9481396bbd831d9bd970515f277de516fa28 (diff)
lcd: mpc823: move mpc823-specific lcd_logo_set_cmap code to mpc8xx_lcd.c
Reduce the bitmap_plot #ifdef complexity by extracting MPC823-specific code for setting cmap into its own implementation of lcd_logo_set_cmap(), implemented in mpc8xx_lcd.c. In the MPC823 implementation, ARRAY_SIZE(bmp_logo_palette) is switched for BMP_LOGO_COLORS to avoid having to include bmp_logo_data.h, which would cause a compilation error because the logo data and palette arrays would be defined twice. This is a step towards cleaning bitmap_plot() of platform-specific code. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Bo Shen <voice.shen@atmel.com> Tested-by: Josh Wu <josh.wu@atmel.com> Cc: Simon Glass <sjg@chromium.org> Cc: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'drivers/video/mpc8xx_lcd.c')
-rw-r--r--drivers/video/mpc8xx_lcd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/video/mpc8xx_lcd.c b/drivers/video/mpc8xx_lcd.c
index 190c05a598..faa58c020b 100644
--- a/drivers/video/mpc8xx_lcd.c
+++ b/drivers/video/mpc8xx_lcd.c
@@ -371,6 +371,21 @@ void fb_put_byte(uchar **fb, uchar **from)
}
#endif
+#ifdef CONFIG_LCD_LOGO
+#include <bmp_logo.h>
+void lcd_logo_set_cmap(void)
+{
+ int i;
+ ushort *cmap;
+ immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+ cpm8xx_t *cp = &(immr->im_cpm);
+ cmap = (ushort *)&(cp->lcd_cmap[BMP_LOGO_OFFSET * sizeof(ushort)]);
+
+ for (i = 0; i < BMP_LOGO_COLORS; ++i)
+ *cmap++ = bmp_logo_palette[i];
+}
+#endif
+
void lcd_enable (void)
{
volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;