video: restore CONFIG_VIDCONSOLE_AS_LCD as boolean
authorPatrick Delaunay <patrick.delaunay@st.com>
Wed, 1 Jul 2020 12:56:10 +0000 (14:56 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 6 Jul 2020 20:30:00 +0000 (16:30 -0400)
This patch restores CONFIG_VIDCONSOLE_AS_LCD as boolean
and introduce a separate sting as CONFIG_VIDCONSOLE_AS_NAME
to search this string in stdout used as videoconsole.

This patch avoid issue with board defconfig or code expecting
CONFIG_VIDCONSOLE_AS_LCD as boolean.

Fixes: 22b897a12323 ("video: extend stdout video console work-around for 'vga'")
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
common/console.c
drivers/video/Kconfig

index f149624..7b98169 100644 (file)
@@ -713,7 +713,7 @@ struct stdio_dev *search_device(int flags, const char *name)
 
        dev = stdio_get_by_name(name);
 #ifdef CONFIG_VIDCONSOLE_AS_LCD
-       if (!dev && !strcmp(name, CONFIG_VIDCONSOLE_AS_LCD))
+       if (!dev && !strcmp(name, CONFIG_VIDCONSOLE_AS_NAME))
                dev = stdio_get_by_name("vidconsole");
 #endif
 
@@ -897,9 +897,9 @@ done:
        stdio_print_current_devices();
 #endif /* CONFIG_SYS_CONSOLE_INFO_QUIET */
 #ifdef CONFIG_VIDCONSOLE_AS_LCD
-       if (strstr(stdoutname, CONFIG_VIDCONSOLE_AS_LCD))
+       if (strstr(stdoutname, CONFIG_VIDCONSOLE_AS_NAME))
                printf("Warning: Please change '%s' to 'vidconsole' in stdout/stderr environment vars\n",
-                      CONFIG_VIDCONSOLE_AS_LCD);
+                      CONFIG_VIDCONSOLE_AS_NAME);
 #endif
 
 #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
index 52f5bc6..0cf13ad 100644 (file)
@@ -177,8 +177,18 @@ config SIMPLE_PANEL
 source "drivers/video/fonts/Kconfig"
 
 config VIDCONSOLE_AS_LCD
-       string "Use 'vidconsole' when string defined here is seen in stdout"
+       bool "Use 'vidconsole' when CONFIG_VIDCONSOLE_AS_NAME string is seen in stdout"
        depends on DM_VIDEO
+       help
+         This is a work-around for boards which have 'lcd' or 'vga' 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 2020.
+
+config VIDCONSOLE_AS_NAME
+       string "Use 'vidconsole' when string defined here is seen in stdout"
+       depends on VIDCONSOLE_AS_LCD
        default "lcd" if LCD || TEGRA_COMMON
        default "vga" if !LCD
        help