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];
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");
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));
{
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);
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 */