]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: Name consoles by their number
authorSimon Glass <sjg@chromium.org>
Fri, 22 Jan 2016 02:44:51 +0000 (19:44 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 22 Jan 2016 03:42:36 +0000 (20:42 -0700)
We must use the console name in the 'stdout' variable to select the one
we want. At present the name is formed from the driver name with a suffix
indicating the rotation value.

It seems better to name them sequentially since this can be controlled by
driver order. So adjust the code to use 'vidconsole' for the first,
'vidconsole1' for the second, etc.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/video/vidconsole-uclass.c
include/configs/sandbox.h

index ea10189432fcae3145bb8974d763f9bd22f318a4..706a1894cce91851fe6690bd8789684fdd0fb953 100644 (file)
@@ -161,7 +161,12 @@ static int vidconsole_post_probe(struct udevice *dev)
        struct stdio_dev *sdev = &priv->sdev;
        int ret;
 
-       strlcpy(sdev->name, dev->name, sizeof(sdev->name));
+       if (dev->seq) {
+               snprintf(sdev->name, sizeof(sdev->name), "vidconsole%d",
+                        dev->seq);
+       } else {
+               strcpy(sdev->name, "vidconsole");
+       }
        sdev->flags = DEV_FLAGS_OUTPUT;
        sdev->putc = vidconsole_putc;
        sdev->puts = vidconsole_puts;
index 6498981cef248715e98dabae34b1061616249229..4bffd8d3d30a9d0a15fa748a8db5988176aa7636 100644 (file)
 #define CONFIG_KEYBOARD
 
 #define SANDBOX_SERIAL_SETTINGS                "stdin=serial,cros-ec-keyb,usbkbd\0" \
-                                       "stdout=serial,lcd.vidconsole\0" \
-                                       "stderr=serial,lcd.vidconsole\0"
+                                       "stdout=serial,vidconsole\0" \
+                                       "stderr=serial,vidconsole\0"
 #else
 #define SANDBOX_SERIAL_SETTINGS                "stdin=serial\0" \
-                                       "stdout=serial,lcd.vidconsole\0" \
-                                       "stderr=serial,lcd.vidconsole\0"
+                                       "stdout=serial,vidconsole\0" \
+                                       "stderr=serial,vidconsole\0"
 #endif
 
 #define SANDBOX_ETH_SETTINGS           "ethaddr=00:00:11:22:33:44\0" \