lcd: remove LCD_MONOCHROME
authorNikita Kiryanov <nikita@compulab.co.il>
Mon, 8 Dec 2014 15:14:38 +0000 (17:14 +0200)
committerAnatolij Gustschin <agust@denx.de>
Sat, 10 Jan 2015 16:50:04 +0000 (17:50 +0100)
No one is using LCD_MONOCHROME; remove related code.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>
common/lcd.c
drivers/video/mpc8xx_lcd.c
drivers/video/pxa_lcd.c
include/lcd.h

index 80923e91185f2056f9a0a45f42363fc17e31666b..18f71f245a1133fd749b6e5aac0c612ea30b852b 100644 (file)
 #define CONSOLE_SIZE           (CONSOLE_ROW_SIZE * CONSOLE_ROWS)
 #define CONSOLE_SCROLL_SIZE    (CONSOLE_SIZE - CONSOLE_ROW_SIZE)
 
-#if LCD_BPP == LCD_MONOCHROME
-# define COLOR_MASK(c)         ((c)      | (c) << 1 | (c) << 2 | (c) << 3 | \
-                                (c) << 4 | (c) << 5 | (c) << 6 | (c) << 7)
-#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || \
+#if (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || \
        (LCD_BPP == LCD_COLOR32)
 # define COLOR_MASK(c)         (c)
 #else
@@ -313,10 +310,6 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
        y += BMP_LOGO_HEIGHT;
 #endif
 
-#if LCD_BPP == LCD_MONOCHROME
-       ushort off  = x * (1 << LCD_BPP) % 8;
-#endif
-
        dest = (uchar *)(lcd_base + y * lcd_line_length + x * NBITS(LCD_BPP)/8);
 
        for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
@@ -330,33 +323,18 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
                uchar *d = dest;
 #endif
 
-#if LCD_BPP == LCD_MONOCHROME
-               uchar rest = *d & -(1 << (8 - off));
-               uchar sym;
-#endif
                for (i = 0; i < count; ++i) {
                        uchar c, bits;
 
                        c = *s++;
                        bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
 
-#if LCD_BPP == LCD_MONOCHROME
-                       sym  = (COLOR_MASK(lcd_color_fg) & bits) |
-                               (COLOR_MASK(lcd_color_bg) & ~bits);
-
-                       *d++ = rest | (sym >> off);
-                       rest = sym << (8-off);
-#else /* LCD_BPP == LCD_COLOR8 or LCD_COLOR16 or LCD_COLOR32 */
                        for (c = 0; c < 8; ++c) {
                                *d++ = (bits & 0x80) ?
                                                lcd_color_fg : lcd_color_bg;
                                bits <<= 1;
                        }
-#endif
                }
-#if LCD_BPP == LCD_MONOCHROME
-               *d  = rest | (*d & ((1 << (8 - off)) - 1));
-#endif
        }
 }
 
@@ -443,11 +421,7 @@ int drv_lcd_init(void)
 /*----------------------------------------------------------------------*/
 void lcd_clear(void)
 {
-#if LCD_BPP == LCD_MONOCHROME
-       /* Setting the palette */
-       lcd_initcolregs();
-
-#elif LCD_BPP == LCD_COLOR8
+#if LCD_BPP == LCD_COLOR8
        /* Setting the palette */
        lcd_setcolreg(CONSOLE_COLOR_BLACK, 0, 0, 0);
        lcd_setcolreg(CONSOLE_COLOR_RED, 0xFF, 0, 0);
index ac74fc8ace32d5513001bfcdb008baddbe4cb5f0..add7215992dfbfc924f8f5db63503fa5ff2b93e0 100644 (file)
@@ -357,23 +357,6 @@ lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue)
 
 /*----------------------------------------------------------------------*/
 
-#if LCD_BPP == LCD_MONOCHROME
-static
-void lcd_initcolregs (void)
-{
-       volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-       volatile cpm8xx_t *cp = &(immr->im_cpm);
-       ushort regno;
-
-       for (regno = 0; regno < 16; regno++) {
-               cp->lcd_cmap[regno * 2] = 0;
-               cp->lcd_cmap[(regno * 2) + 1] = regno & 0x0f;
-       }
-}
-#endif
-
-/*----------------------------------------------------------------------*/
-
 void lcd_enable (void)
 {
        volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
index e19f6ac7d87ab6f7cdd331ab8e4c8b19c518bab1..f66f615df595889201c5fd6a4890c0decbb5ab71 100644 (file)
@@ -378,21 +378,6 @@ lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue)
 }
 #endif /* LCD_COLOR8 */
 
-/*----------------------------------------------------------------------*/
-#if LCD_BPP == LCD_MONOCHROME
-void lcd_initcolregs (void)
-{
-       struct pxafb_info *fbi = &panel_info.pxa;
-       cmap = (ushort *)fbi->palette;
-       ushort regno;
-
-       for (regno = 0; regno < 16; regno++) {
-               cmap[regno * 2] = 0;
-               cmap[(regno * 2) + 1] = regno & 0x0f;
-       }
-}
-#endif /* LCD_MONOCHROME */
-
 /*----------------------------------------------------------------------*/
 __weak void lcd_enable(void)
 {
index 020d8800e9e6437fb6af4c70f64518c8f9b66e38..01609ac09f7b43c11394a9eb9f986fe173572914 100644 (file)
@@ -359,15 +359,7 @@ void lcd_sync(void);
 /************************************************************************/
 /* ** CONSOLE CONSTANTS                                                        */
 /************************************************************************/
-#if LCD_BPP == LCD_MONOCHROME
-
-/*
- * Simple black/white definitions
- */
-# define CONSOLE_COLOR_BLACK   0
-# define CONSOLE_COLOR_WHITE   1       /* Must remain last / highest   */
-
-#elif LCD_BPP == LCD_COLOR8
+#if LCD_BPP == LCD_COLOR8
 
 /*
  * 8bpp color definitions