From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bo Shen Date: Wed, 4 Feb 2015 15:26:34 +0800 Subject: [U-Boot] [PATCH V2 03/13] lcd: atmel: move atmel-specific fb_put_word to atmel_lcdfb In-Reply-To: <1422963152-17634-4-git-send-email-nikita@compulab.co.il> References: <1422963152-17634-1-git-send-email-nikita@compulab.co.il> <1422963152-17634-4-git-send-email-nikita@compulab.co.il> Message-ID: <54D1C9AA.7070204@atmel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 02/03/2015 07:32 PM, Nikita Kiryanov wrote: > 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 > Cc: Bo Shen > Cc: Simon Glass > Cc: Anatolij Gustschin Acked-by: Bo Shen > --- > Changes in V2: > - Minor commit message update > > common/lcd.c | 11 +---------- > drivers/video/atmel_lcdfb.c | 9 +++++++++ > 2 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/common/lcd.c b/common/lcd.c > index 0f6c2e4..f17b35b 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) > diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c > index fa6a82c..c7991cd 100644 > --- a/drivers/video/atmel_lcdfb.c > +++ b/drivers/video/atmel_lcdfb.c > @@ -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) >