sunxi: video: Remove sunxi_display.enabled variable

Having both a sunxi_display.enabled variable and
sunxi_display.monitor == sunxi_monitor_none duplicates state, use
sunxi_display.monitor = sunxi_monitor_none when ever we do not have a display.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
This commit is contained in:
Hans de Goede 2014-12-24 19:47:14 +01:00
parent 7398fd58e6
commit b98d048030

View file

@ -34,7 +34,6 @@ enum sunxi_monitor {
struct sunxi_display { struct sunxi_display {
GraphicDevice graphic_device; GraphicDevice graphic_device;
bool enabled;
enum sunxi_monitor monitor; enum sunxi_monitor monitor;
unsigned int depth; unsigned int depth;
} sunxi_display; } sunxi_display;
@ -838,6 +837,7 @@ void *video_hw_init(void)
case sunxi_monitor_hdmi: case sunxi_monitor_hdmi:
#ifndef CONFIG_VIDEO_HDMI #ifndef CONFIG_VIDEO_HDMI
printf("HDMI/DVI not supported on this board\n"); printf("HDMI/DVI not supported on this board\n");
sunxi_display.monitor = sunxi_monitor_none;
return NULL; return NULL;
#else #else
/* Always call hdp_detect, as it also enables clocks, etc. */ /* Always call hdp_detect, as it also enables clocks, etc. */
@ -853,8 +853,10 @@ void *video_hw_init(void)
sunxi_hdmi_shutdown(); sunxi_hdmi_shutdown();
if (lcd_mode[0] == 0) if (lcd_mode[0] == 0) {
sunxi_display.monitor = sunxi_monitor_none;
return NULL; /* No LCD, bail */ return NULL; /* No LCD, bail */
}
/* Fall back / through to LCD */ /* Fall back / through to LCD */
sunxi_display.monitor = sunxi_monitor_lcd; sunxi_display.monitor = sunxi_monitor_lcd;
@ -866,6 +868,7 @@ void *video_hw_init(void)
break; break;
} }
printf("LCD not supported on this board\n"); printf("LCD not supported on this board\n");
sunxi_display.monitor = sunxi_monitor_none;
return NULL; return NULL;
case sunxi_monitor_vga: case sunxi_monitor_vga:
#ifdef CONFIG_VIDEO_VGA_VIA_LCD #ifdef CONFIG_VIDEO_VGA_VIA_LCD
@ -873,6 +876,7 @@ void *video_hw_init(void)
break; break;
#else #else
printf("VGA not supported on this board\n"); printf("VGA not supported on this board\n");
sunxi_display.monitor = sunxi_monitor_none;
return NULL; return NULL;
#endif #endif
} }
@ -885,7 +889,6 @@ void *video_hw_init(void)
mode->yres, sunxi_get_mon_desc(sunxi_display.monitor)); mode->yres, sunxi_get_mon_desc(sunxi_display.monitor));
} }
sunxi_display.enabled = true;
sunxi_engines_init(); sunxi_engines_init();
sunxi_mode_set(mode, gd->fb_base - CONFIG_SYS_SDRAM_BASE); sunxi_mode_set(mode, gd->fb_base - CONFIG_SYS_SDRAM_BASE);
@ -913,9 +916,6 @@ int sunxi_simplefb_setup(void *blob)
int offset, ret; int offset, ret;
const char *pipeline = NULL; const char *pipeline = NULL;
if (!sunxi_display.enabled)
return 0;
switch (sunxi_display.monitor) { switch (sunxi_display.monitor) {
case sunxi_monitor_none: case sunxi_monitor_none:
return 0; return 0;