]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - drivers/video/video-uclass.c
dm: video: Add a uclass for the text console
[people/ms/u-boot.git] / drivers / video / video-uclass.c
index 1615889626d80e2b400a6adfa19708a1334c3aff..63d0d9d7d3f5586f41b06f288db51e58295c8d29 100644 (file)
@@ -189,6 +189,27 @@ static int video_post_probe(struct udevice *dev)
 #endif
        video_clear(dev);
 
+       /*
+        * Create a text console devices. For now we always do this, although
+        * it might be useful to support only bitmap drawing on the device
+        * for boards that don't need to display text.
+        */
+       snprintf(name, sizeof(name), "%s.vidconsole", dev->name);
+       str = strdup(name);
+       if (!str)
+               return -ENOMEM;
+       snprintf(drv, sizeof(drv), "vidconsole%d", priv->rot);
+       ret = device_bind_driver(dev, drv, str, &cons);
+       if (ret) {
+               debug("%s: Cannot bind console driver\n", __func__);
+               return ret;
+       }
+       ret = device_probe(cons);
+       if (ret) {
+               debug("%s: Cannot probe console driver\n", __func__);
+               return ret;
+       }
+
        return 0;
 };