]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
karo: tx48: update video_mode handling
authorLothar Waßmann <LW@KARO-electronics.de>
Fri, 22 Nov 2013 09:01:50 +0000 (10:01 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 22 Nov 2013 09:01:50 +0000 (10:01 +0100)
board/karo/tx48/tx48.c

index 45140ee101a660347f0baef1f94f487199ed50ee..7f49d62f8b4186aee4a6e99dffb65bcdb8ef4e55 100644 (file)
@@ -609,7 +609,8 @@ void lcd_panel_disable(void)
 void lcd_ctrl_init(void *lcdbase)
 {
        int color_depth = 24;
-       char *vm, *v;
+       const char *video_mode = getenv("video_mode");
+       const char *vm;
        unsigned long val;
        int refresh = 60;
        struct fb_videomode *p = &tx48_fb_modes[0];
@@ -630,16 +631,13 @@ void lcd_ctrl_init(void *lcdbase)
 
        karo_fdt_move_fdt();
 
-       vm = getenv("video_mode");
+       vm = karo_fdt_set_display(video_mode, "/panel", NULL);
        if (vm == NULL) {
                debug("Disabling LCD\n");
                lcd_enabled = 0;
                return;
        }
-
-       if ((v = strstr(vm, ":")))
-               vm = v + 1;
-
+       video_mode = vm;
        if (karo_fdt_get_fb_mode(working_fdt, vm, &fb_mode) == 0) {
                p = &fb_mode;
                debug("Using video mode from FDT\n");
@@ -763,14 +761,13 @@ void lcd_ctrl_init(void *lcdbase)
 
        if (p != &fb_mode) {
                int ret;
-               char *modename = getenv("video_mode");
 
-               printf("Creating new display-timing node from '%s'\n",
-                       modename);
-               ret = karo_fdt_create_fb_mode(working_fdt, modename, p);
+               debug("Creating new display-timing node from '%s'\n",
+                       video_mode);
+               ret = karo_fdt_create_fb_mode(working_fdt, video_mode, p);
                if (ret)
                        printf("Failed to create new display-timing node from '%s': %d\n",
-                               modename, ret);
+                               video_mode, ret);
        }
 
        gpio_request_array(stk5_lcd_gpios, ARRAY_SIZE(stk5_lcd_gpios));
@@ -1064,6 +1061,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 {
        const char *baseboard = getenv("baseboard");
        int stk5_v5 = baseboard != NULL && (strcmp(baseboard, "stk5-v5") == 0);
+       const char *video_mode = getenv("video_mode");
 
        fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
        fdt_fixup_ethernet(blob);
@@ -1071,6 +1069,9 @@ void ft_board_setup(void *blob, bd_t *bd)
        karo_fdt_fixup_touchpanel(blob);
        karo_fdt_fixup_flexcan(blob, stk5_v5);
 
+       video_mode = karo_fdt_set_display(video_mode, "/panel", NULL);
+       karo_fdt_update_fb_mode(blob, video_mode);
+
        tx48_disable_watchdog();
 }
 #endif /* CONFIG_OF_BOARD_SETUP */