]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/tx6/tx6qdl.c
karo: tx6: set LCD x, y dimensions to 0 when disabling LCD
[karo-tx-uboot.git] / board / karo / tx6 / tx6qdl.c
index f0076e6ccdeee20342e6c73112534ec5077ab2e6..5a0e2a819359cce05be1d6ff5579869b3dc17be1 100644 (file)
@@ -803,14 +803,12 @@ static const struct gpio stk5_gpios[] = {
 };
 
 #ifdef CONFIG_LCD
-static u16 tx6_cmap[256];
 vidinfo_t panel_info = {
        /* set to max. size supported by SoC */
        .vl_col = 1920,
        .vl_row = 1080,
 
        .vl_bpix = LCD_COLOR32,    /* Bits per pixel, 0: 1bpp, 1: 2bpp, 2: 4bpp, 3: 8bpp ... */
-       .cmap = tx6_cmap,
 };
 
 static struct fb_videomode tx6_fb_modes[] = {
@@ -1093,6 +1091,7 @@ void lcd_ctrl_init(void *lcdbase)
 
        if (!lcd_enabled) {
                debug("LCD disabled\n");
+               goto disable;
                return;
        }
 
@@ -1100,6 +1099,7 @@ void lcd_ctrl_init(void *lcdbase)
                debug("Disabling LCD\n");
                lcd_enabled = 0;
                setenv("splashimage", NULL);
+               goto disable;
                return;
        }
 
@@ -1109,6 +1109,7 @@ void lcd_ctrl_init(void *lcdbase)
        if (video_mode == NULL) {
                debug("Disabling LCD\n");
                lcd_enabled = 0;
+               goto disable;
                return;
        }
        vm = video_mode;
@@ -1122,6 +1123,7 @@ void lcd_ctrl_init(void *lcdbase)
                                fb_mode.xres, fb_mode.yres,
                                panel_info.vl_col, panel_info.vl_row);
                        lcd_enabled = 0;
+                       goto disable;
                        return;
                }
        }
@@ -1213,12 +1215,14 @@ void lcd_ctrl_init(void *lcdbase)
                        printf(" %s", p->name);
                }
                printf("\n");
+               goto disable;
                return;
        }
        if (p->xres > panel_info.vl_col || p->yres > panel_info.vl_row) {
                printf("video resolution: %dx%d exceeds hardware limits: %dx%d\n",
                        p->xres, p->yres, panel_info.vl_col, panel_info.vl_row);
                lcd_enabled = 0;
+               goto disable;
                return;
        }
        panel_info.vl_col = p->xres;
@@ -1277,6 +1281,7 @@ void lcd_ctrl_init(void *lcdbase)
                lcd_enabled = 0;
                printf("Invalid %s bus width: %d\n", is_lvds() ? "LVDS" : "LCD",
                        lcd_bus_width);
+               goto disable;
                return;
        }
        if (is_lvds()) {
@@ -1288,6 +1293,7 @@ void lcd_ctrl_init(void *lcdbase)
                if (lvds_chan_mask == 0) {
                        printf("No LVDS channel active\n");
                        lcd_enabled = 0;
+                       goto disable;
                        return;
                }
 
@@ -1317,6 +1323,13 @@ void lcd_ctrl_init(void *lcdbase)
        } else {
                debug("Skipping initialization of LCD controller\n");
        }
+       return;
+
+disable:
+       lcd_enabled = 0;
+       panel_info.vl_col = 0;
+       panel_info.vl_row = 0;
+
 }
 #else
 #define lcd_enabled 0