]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
common/lcd.c: cleanup use of global variables
authorWolfgang Denk <wd@denx.de>
Sat, 5 Jan 2013 09:45:48 +0000 (09:45 +0000)
committerAnatolij Gustschin <agust@denx.de>
Thu, 21 Mar 2013 08:05:08 +0000 (09:05 +0100)
lcd_color_fg and lcd_color_bg had to be declared in board specific
code, but were not actually used there; in addition, we have getter /
setter functions for these, which were not used either.

Get rid of the global variables, and use the getter function where
needed (so far no setter calls are needed).

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Alessandro Rubini <rubini@unipv.it>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Bo Shen <voice.shen@atmel.com>
Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stelian Pop <stelian@popies.net>
Cc: Tom Warren <twarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Jeroen Hofstee <jeroen@myspectrum.nl>
[agust: also fixed cm_t35 board while rebasing]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
arch/arm/cpu/pxa/pxafb.c
arch/powerpc/cpu/mpc8xx/lcd.c
board/cm_t35/display.c
board/mcc200/lcd.c
common/lcd.c
drivers/video/amba.c
drivers/video/atmel_hlcdfb.c
drivers/video/atmel_lcdfb.c
drivers/video/exynos_fb.c
drivers/video/tegra.c
include/lcd.h

index 987fa0682c8d5b9da794e223bfdfeca1f510dc93..25747b112e0ca8d9d8a147845d48dd15c2e00502 100644 (file)
@@ -333,8 +333,6 @@ void lcd_ctrl_init  (void *lcdbase);
 void lcd_enable        (void);
 
 int lcd_line_length;
-int lcd_color_fg;
-int lcd_color_bg;
 
 void *lcd_base;                        /* Start of framebuffer memory  */
 void *lcd_console_address;             /* Start of console buffer      */
index 4b88b21b3f0cae1247389bd3cb59f64f28cc91a0..4fd44acd12f56598078d125d079dafbeb1f59b93 100644 (file)
@@ -258,9 +258,6 @@ vidinfo_t panel_info = {
 
 int lcd_line_length;
 
-int lcd_color_fg;
-int lcd_color_bg;
-
 /*
  * Frame buffer memory information
  */
index 2f78bad6ea1698dc3a5b88a2a11c839097566f62..885c484ccf81c2f5411d25f4ddb33b0fed393b50 100644 (file)
@@ -382,8 +382,6 @@ static enum display_type env_parse_displaytype(char *displaytype)
 }
 
 int lcd_line_length;
-int lcd_color_fg;
-int lcd_color_bg;
 void *lcd_base;
 short console_col;
 short console_row;
index 893f4b7cb8d1462e6cbeea3ffa1807fd69dc0940..0f3f585d601301c6f606893225002cde0383de56 100644 (file)
@@ -70,9 +70,6 @@ vidinfo_t panel_info = {
 
 int lcd_line_length;
 
-int lcd_color_fg;
-int lcd_color_bg;
-
 /*
  * Frame buffer memory information
  */
index 590bbb9301fd7c9e456dd355ab30af005da5ee6b..b09e45fc18ddf7df71432da30d06a5956e1d9be5 100644 (file)
@@ -99,6 +99,9 @@ static int lcd_getbgcolor(void);
 static void lcd_setfgcolor(int color);
 static void lcd_setbgcolor(int color);
 
+static int lcd_color_fg;
+static int lcd_color_bg;
+
 char lcd_is_enabled = 0;
 
 static char lcd_flush_dcache;  /* 1 to flush dcache after each lcd update */
@@ -534,12 +537,10 @@ static void lcd_setbgcolor(int color)
 
 /*----------------------------------------------------------------------*/
 
-#ifdef NOT_USED_SO_FAR
-static int lcd_getfgcolor(void)
+int lcd_getfgcolor(void)
 {
        return lcd_color_fg;
 }
-#endif /* NOT_USED_SO_FAR */
 
 /*----------------------------------------------------------------------*/
 
index ffa1c399e1418d797084012580f0d8c3e4dabea2..b4fb47da4c35b2571a907f220c37188141c84c44 100644 (file)
@@ -29,8 +29,6 @@
 
 /* These variables are required by lcd.c -- although it sets them by itself */
 int lcd_line_length;
-int lcd_color_fg;
-int lcd_color_bg;
 void *lcd_base;
 void *lcd_console_address;
 short console_col;
index b10ca4b67719b33368b540ef941e4e09ffd8349f..e74eb65f3e1a14aa2b14ba5f5adeb041c6753b38 100644 (file)
@@ -30,8 +30,6 @@
 #include <atmel_hlcdc.h>
 
 int lcd_line_length;
-int lcd_color_fg;
-int lcd_color_bg;
 
 void *lcd_base;                                /* Start of framebuffer memory  */
 void *lcd_console_address;             /* Start of console buffer      */
index c02ffd8036394fdc6eacaadcb52c6226a6ca1ef0..d96f175c5c17345dc2aa21e70e07e50832917fb7 100644 (file)
@@ -30,8 +30,6 @@
 #include <atmel_lcdc.h>
 
 int lcd_line_length;
-int lcd_color_fg;
-int lcd_color_bg;
 
 void *lcd_base;                                /* Start of framebuffer memory  */
 void *lcd_console_address;             /* Start of console buffer      */
index ee0ed06d6fe60d711a420b8710e996cb487fa9e8..4536c5c0e863ab2f4f6ebfd262cbf8bed7cb07b7 100644 (file)
@@ -34,8 +34,6 @@
 #include "exynos_fb.h"
 
 int lcd_line_length;
-int lcd_color_fg;
-int lcd_color_bg;
 
 void *lcd_base;
 void *lcd_console_address;
index afcb00881e53202944b03539f22fa5d42324550c..00d855356f4c782a2f855f5837d3b17ea47a3697 100644 (file)
@@ -61,8 +61,6 @@ enum {
 };
 
 int lcd_line_length;
-int lcd_color_fg;
-int lcd_color_bg;
 
 void *lcd_base;                        /* Start of framebuffer memory  */
 void *lcd_console_address;     /* Start of console buffer      */
@@ -108,7 +106,7 @@ void lcd_toggle_cursor(void)
 
                for (i = 0; i < lcd_cursor_width; ++i) {
                        color = *d;
-                       color ^= lcd_color_fg;
+                       color ^= lcd_getfgcolor();
                        *d = color;
                        ++d;
                }
index 4ac4ddd1e0edc35648c6e87f44974bdc23846c33..e8c6c96f5c597cf6c5de03c2b3f3aedb2ebe97ec 100644 (file)
 extern char lcd_is_enabled;
 
 extern int lcd_line_length;
-extern int lcd_color_fg;
-extern int lcd_color_bg;
 
 /*
  * Frame buffer memory information
  */
-extern void *lcd_base;         /* Start of framebuffer memory  */
+extern void *lcd_base;                 /* Start of framebuffer memory  */
 extern void *lcd_console_address;      /* Start of console buffer      */
 
 extern short console_col;
@@ -54,6 +52,8 @@ extern void lcd_setcolreg (ushort regno,
                                ushort red, ushort green, ushort blue);
 extern void lcd_initcolregs (void);
 
+extern int lcd_getfgcolor(void);
+
 /* gunzip_bmp used if CONFIG_VIDEO_BMP_GZIP */
 extern struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp);
 extern int bmp_display(ulong addr, int x, int y);