dm: video: Add a temporary work-around for old stdout var
authorSimon Glass <sjg@chromium.org>
Sat, 6 Feb 2016 21:31:37 +0000 (14:31 -0700)
committerAnatolij Gustschin <agust@denx.de>
Thu, 11 Feb 2016 20:37:17 +0000 (21:37 +0100)
Boards with a saved environment may use 'lcd' in their stdout environment
variable, expecting that this will enable output to the LCD. When the board
moves to use driver model for video, this will no-longer work. Add a
work-around to fix this. A warning messages is printed, and we will remove
the work-around at the end of 2016.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
common/console.c
drivers/video/Kconfig

index b3f5fdc..6a0d11b 100644 (file)
@@ -650,6 +650,10 @@ struct stdio_dev *search_device(int flags, const char *name)
        struct stdio_dev *dev;
 
        dev = stdio_get_by_name(name);
+#ifdef CONFIG_VIDCONSOLE_AS_LCD
+       if (!dev && !strcmp(name, "lcd"))
+               dev = stdio_get_by_name("vidconsole");
+#endif
 
        if (dev && (dev->flags & flags))
                return dev;
@@ -795,6 +799,10 @@ done:
 #ifndef CONFIG_SYS_CONSOLE_INFO_QUIET
        stdio_print_current_devices();
 #endif /* CONFIG_SYS_CONSOLE_INFO_QUIET */
+#ifdef CONFIG_VIDCONSOLE_AS_LCD
+       if (strstr(stdoutname, "lcd"))
+               printf("Warning: Please change 'lcd' to 'vidconsole' in stdout/stderr environment vars\n");
+#endif
 
 #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
        /* set the environment variables (will overwrite previous env settings) */
index fbc5d7c..19f9429 100644 (file)
@@ -91,6 +91,16 @@ config CONSOLE_TRUETYPE_SIZE
 
 source "drivers/video/fonts/Kconfig"
 
+config VIDCONSOLE_AS_LCD
+       bool "Use 'vidconsole' when 'lcd' is seen in stdout"
+       depends on DM_VIDEO
+       help
+         This is a work-around for boards which have 'lcd' in their stdout
+         environment variable, but have moved to use driver model for video.
+         In this case the console will no-longer work. While it is possible
+         to update the environment, the breakage may be confusing for users.
+         This option will be removed around the end of 2016.
+
 config VIDEO_VESA
        bool "Enable VESA video driver support"
        default n