]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
lcd: mpc8xx: move mpc823-specific fb_put_byte to mpc8xx_lcd.c
authorNikita Kiryanov <nikita@compulab.co.il>
Tue, 3 Feb 2015 11:32:23 +0000 (13:32 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 11:41:25 +0000 (13:41 +0200)
Reduce the amount of platform-specific code in common/lcd.c by moving MPC823
implementation of fb_put_byte() to mpc8xx_lcd.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>
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>
common/lcd.c
drivers/video/mpc8xx_lcd.c

index 628e9c2b1743855835eaee26d48e98c090eb7052..47a4f3533b09ab513d5f8acc3a189c9c2e649016 100644 (file)
@@ -661,11 +661,10 @@ static void lcd_display_rle8_bitmap(bmp_image_t *bmp, ushort *cmap, uchar *fb,
 }
 #endif
 
-#if defined(CONFIG_MPC823)
-#define FB_PUT_BYTE(fb, from) *(fb)++ = (255 - *(from)++)
-#else
-#define FB_PUT_BYTE(fb, from) *(fb)++ = *(from)++
-#endif
+__weak void fb_put_byte(uchar **fb, uchar **from)
+{
+       *(*fb)++ = *(*from)++;
+}
 
 #if defined(CONFIG_BMP_16BPP)
 __weak void fb_put_word(uchar **fb, uchar **from)
index 9d2e5edc72ec4d0df92a2f3903a112e035dcd7d5..190c05a5980520623e82372a05f18b93e6082431 100644 (file)
@@ -364,6 +364,13 @@ ushort *configuration_get_cmap(void)
        return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
 }
 
+#if defined(CONFIG_MPC823)
+void fb_put_byte(uchar **fb, uchar **from)
+{
+       *(*fb)++ = (255 - *(*from)++);
+}
+#endif
+
 void lcd_enable (void)
 {
        volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;