common/lcd.c: cleanup use of global variables

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>
master
Wolfgang Denk 12 years ago committed by Anatolij Gustschin
parent 8b906a9f0b
commit 46d1d5dd43
  1. 2
      arch/arm/cpu/pxa/pxafb.c
  2. 3
      arch/powerpc/cpu/mpc8xx/lcd.c
  3. 2
      board/cm_t35/display.c
  4. 3
      board/mcc200/lcd.c
  5. 7
      common/lcd.c
  6. 2
      drivers/video/amba.c
  7. 2
      drivers/video/atmel_hlcdfb.c
  8. 2
      drivers/video/atmel_lcdfb.c
  9. 2
      drivers/video/exynos_fb.c
  10. 4
      drivers/video/tegra.c
  11. 6
      include/lcd.h

@ -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 */

@ -258,9 +258,6 @@ vidinfo_t panel_info = {
int lcd_line_length;
int lcd_color_fg;
int lcd_color_bg;
/*
* Frame buffer memory information
*/

@ -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;

@ -70,9 +70,6 @@ vidinfo_t panel_info = {
int lcd_line_length;
int lcd_color_fg;
int lcd_color_bg;
/*
* Frame buffer memory information
*/

@ -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 */
/*----------------------------------------------------------------------*/

@ -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;

@ -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 */

@ -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 */

@ -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;

@ -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;
}

@ -32,13 +32,11 @@
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);

Loading…
Cancel
Save