]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lcd: split configuration_get_cmap
authorNikita Kiryanov <nikita@compulab.co.il>
Tue, 3 Feb 2015 11:32:21 +0000 (13:32 +0200)
committerAnatolij Gustschin <agust@denx.de>
Tue, 10 Feb 2015 12:25:08 +0000 (13:25 +0100)
configuration_get_cmap() is multiple platform-specific functions stuffed into
one function. Split it into multiple versions, and move each version to the
appropriate driver to reduce the #ifdef complexity.

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: Bo Shen <voice.shen@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
common/lcd.c
drivers/video/atmel_hlcdfb.c
drivers/video/atmel_lcdfb.c
drivers/video/exynos_fb.c
drivers/video/mpc8xx_lcd.c
drivers/video/pxa_lcd.c
include/lcd.h

index 1195a54efcc742837f3cb703b4c8ad6f5d356569..0f6c2e4c25b7601cceddbb223279f09d7da6b7e0 100644 (file)
@@ -383,25 +383,6 @@ int lcd_getbgcolor(void)
 /************************************************************************/
 /* ** Chipset depending Bitmap / Logo stuff...                          */
 /************************************************************************/
-static inline ushort *configuration_get_cmap(void)
-{
-#if defined CONFIG_CPU_PXA
-       struct pxafb_info *fbi = &panel_info.pxa;
-       return (ushort *)fbi->palette;
-#elif defined(CONFIG_MPC823)
-       immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-       cpm8xx_t *cp = &(immr->im_cpm);
-       return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
-#elif defined(CONFIG_ATMEL_LCD)
-       return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
-#elif !defined(CONFIG_ATMEL_HLCD) && !defined(CONFIG_EXYNOS_FB)
-       return panel_info.cmap;
-#elif defined(CONFIG_LCD_LOGO)
-       return bmp_logo_palette;
-#else
-       return NULL;
-#endif
-}
 
 #ifdef CONFIG_LCD_LOGO
 void bitmap_plot(int x, int y)
index 935ae42a9c873904ff8e7a174332438fe5d7d34c..0ce237094dd79ee3e4a1db42b6eebb377953b747 100644 (file)
 #include <lcd.h>
 #include <atmel_hlcdc.h>
 
+#if defined(CONFIG_LCD_LOGO)
+#include <bmp_logo.h>
+#endif
+
 /* configurable parameters */
 #define ATMEL_LCDC_CVAL_DEFAULT                0xc8
 #define ATMEL_LCDC_DMA_BURST_LEN       8
@@ -37,6 +41,15 @@ void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
                panel_info.mmio + ATMEL_LCDC_LUT(regno));
 }
 
+ushort *configuration_get_cmap(void)
+{
+#if defined(CONFIG_LCD_LOGO)
+       return bmp_logo_palette;
+#else
+       return NULL;
+#endif
+}
+
 void lcd_ctrl_init(void *lcdbase)
 {
        unsigned long value;
index 3cf008ce6ba384987deba6e2d183e24eba7ad612..fa6a82cfaf6f37b4e655080675e4abf7809184c3 100644 (file)
 #define lcdc_readl(mmio, reg)          __raw_readl((mmio)+(reg))
 #define lcdc_writel(mmio, reg, val)    __raw_writel((val), (mmio)+(reg))
 
+ushort *configuration_get_cmap(void)
+{
+       return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
+}
+
 void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
 {
 #if defined(CONFIG_ATMEL_LCD_BGR555)
index be35b982acd12f6019281248145a06124a483720..c5d73308047fac83a9a663a136a6b3c1e3ed7a78 100644 (file)
@@ -37,6 +37,15 @@ vidinfo_t panel_info  = {
 };
 #endif
 
+ushort *configuration_get_cmap(void)
+{
+#if defined(CONFIG_LCD_LOGO)
+       return bmp_logo_palette;
+#else
+       return NULL;
+#endif
+}
+
 static void exynos_lcd_init_mem(void *lcdbase, vidinfo_t *vid)
 {
        unsigned long palette_size;
index add7215992dfbfc924f8f5db63503fa5ff2b93e0..9d2e5edc72ec4d0df92a2f3903a112e035dcd7d5 100644 (file)
@@ -357,6 +357,13 @@ lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue)
 
 /*----------------------------------------------------------------------*/
 
+ushort *configuration_get_cmap(void)
+{
+       immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+       cpm8xx_t *cp = &(immr->im_cpm);
+       return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
+}
+
 void lcd_enable (void)
 {
        volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
index f66f615df595889201c5fd6a4890c0decbb5ab71..04105d4eaa88f98a270e76b1abaa2c39464fa360 100644 (file)
@@ -342,6 +342,12 @@ static int pxafb_init (vidinfo_t *vid);
 /* ---------------  PXA chipset specific functions  ------------------- */
 /************************************************************************/
 
+ushort *configuration_get_cmap(void)
+{
+       struct pxafb_info *fbi = &panel_info.pxa;
+       return (ushort *)fbi->palette;
+}
+
 void lcd_ctrl_init (void *lcdbase)
 {
        pxafb_init_mem(lcdbase, &panel_info);
index fbba6a27f9f8b81239d5ede95f341bea118dc809..4ada617e021c8078414a3e78730a2633498c8b3e 100644 (file)
@@ -60,8 +60,15 @@ typedef struct vidinfo {
 
        void    *priv;          /* Pointer to driver-specific data */
 } vidinfo_t;
+
+static __maybe_unused ushort *configuration_get_cmap(void)
+{
+       return panel_info.cmap;
+}
 #endif
 
+ushort *configuration_get_cmap(void);
+
 extern vidinfo_t panel_info;
 
 /* Video functions */