]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
lcd: atmel: move atmel-specific fb_put_word to atmel_lcdfb
authorNikita Kiryanov <nikita@compulab.co.il>
Tue, 3 Feb 2015 11:32:22 +0000 (13:32 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 11:39:10 +0000 (13:39 +0200)
Reduce the amount of platform-specific code in common/lcd.c by moving Atmel
implementation of fb_put_word() to atmel_lcdfb.c. Since we must also have a
default implementation for everybody else, make the remainder of the code
into a weak function.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Cc: Bo Shen <voice.shen@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
common/lcd.c
drivers/video/atmel_lcdfb.c

index 7e238f5bfe25cc1e533d5a7e92528f59e1ff1137..628e9c2b1743855835eaee26d48e98c090eb7052 100644 (file)
@@ -668,20 +668,11 @@ static void lcd_display_rle8_bitmap(bmp_image_t *bmp, ushort *cmap, uchar *fb,
 #endif
 
 #if defined(CONFIG_BMP_16BPP)
-#if defined(CONFIG_ATMEL_LCD_BGR555)
-static inline void fb_put_word(uchar **fb, uchar **from)
-{
-       *(*fb)++ = (((*from)[0] & 0x1f) << 2) | ((*from)[1] & 0x03);
-       *(*fb)++ = ((*from)[0] & 0xe0) | (((*from)[1] & 0x7c) >> 2);
-       *from += 2;
-}
-#else
-static inline void fb_put_word(uchar **fb, uchar **from)
+__weak void fb_put_word(uchar **fb, uchar **from)
 {
        *(*fb)++ = *(*from)++;
        *(*fb)++ = *(*from)++;
 }
-#endif
 #endif /* CONFIG_BMP_16BPP */
 
 static inline bmp_color_table_entry_t *get_color_table(bmp_image_t *bmp)
index 50d3befad8a1e14b39ad00e56b113ae0cff85e06..055c717f0db433014ba578ab0362a09e293ecd84 100644 (file)
@@ -34,6 +34,15 @@ ushort *configuration_get_cmap(void)
        return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
 }
 
+#if defined(CONFIG_BMP_16BPP) && defined(CONFIG_ATMEL_LCD_BGR555)
+void fb_put_word(uchar **fb, uchar **from)
+{
+       *(*fb)++ = (((*from)[0] & 0x1f) << 2) | ((*from)[1] & 0x03);
+       *(*fb)++ = ((*from)[0] & 0xe0) | (((*from)[1] & 0x7c) >> 2);
+       *from += 2;
+}
+#endif
+
 void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
 {
 #if defined(CONFIG_ATMEL_LCD_BGR555)