From b3d12e9bca1b23a537d77af2ae019cddc59f2031 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Tue, 3 Feb 2015 13:32:22 +0200 Subject: lcd: atmel: move atmel-specific fb_put_word to atmel_lcdfb 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 Reviewed-by: Simon Glass Acked-by: Bo Shen Tested-by: Bo Shen Tested-by: Josh Wu Cc: Bo Shen Cc: Simon Glass Cc: Anatolij Gustschin --- common/lcd.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'common') diff --git a/common/lcd.c b/common/lcd.c index 0f6c2e4c25..f17b35b7fe 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -642,20 +642,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 */ int lcd_display_bitmap(ulong bmp_image, int x, int y) -- cgit v1.2.1