diff options
author | Simon Glass <sjg@chromium.org> | 2016-01-18 19:52:17 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-01-20 19:10:15 -0700 |
commit | 83510766c90a52e58477267704fc5ca8f75c3dab (patch) | |
tree | 3ca2e70d5ccab5fc26d5b01c012c8d77112414fa /drivers/video/video-uclass.c | |
parent | 6cbf5de7082fdee0bdbc3dd5fe7ac4c84cbf9f7d (diff) | |
download | u-boot-imx-83510766c90a52e58477267704fc5ca8f75c3dab.zip u-boot-imx-83510766c90a52e58477267704fc5ca8f75c3dab.tar.gz u-boot-imx-83510766c90a52e58477267704fc5ca8f75c3dab.tar.bz2 |
dm: video: Add a uclass for the text console
The existing LCD/video interface suffers from conflating the bitmap display
with text output on that display. As a result the implementation is more
complex than it needs to me.
We can support multiple text console drivers. Create a separate uclass to
support this, with its own API.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'drivers/video/video-uclass.c')
-rw-r--r-- | drivers/video/video-uclass.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 1615889..63d0d9d 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -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; }; |