diff options
author | Mario Six <mario.six@gdsys.cc> | 2018-09-27 10:19:29 +0300 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2018-09-28 19:26:32 +0300 |
commit | 39a336f116e97d936268b1d317f22a007a01528d (patch) | |
tree | d7e3a91fe0a0fab6447405114eb3b728602baa8e /drivers/video/video_osd-uclass.c | |
parent | 662f381aad11246109b660a36b9028fd76714be0 (diff) | |
download | u-boot-39a336f116e97d936268b1d317f22a007a01528d.tar.xz |
drivers: Add OSD uclass
Some devices offer a text-based OSD (on-screen display) that can be
programmatically controlled (i.e. text displayed on).
Add a uclass to support such devices.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Diffstat (limited to 'drivers/video/video_osd-uclass.c')
-rw-r--r-- | drivers/video/video_osd-uclass.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/video/video_osd-uclass.c b/drivers/video/video_osd-uclass.c new file mode 100644 index 0000000000..82136a292b --- /dev/null +++ b/drivers/video/video_osd-uclass.c @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2017 + * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc + */ + +#include <common.h> +#include <dm.h> +#include <video_osd.h> + +int video_osd_get_info(struct udevice *dev, struct video_osd_info *info) +{ + struct video_osd_ops *ops = video_osd_get_ops(dev); + + return ops->get_info(dev, info); +} + +int video_osd_set_mem(struct udevice *dev, uint col, uint row, u8 *buf, + size_t buflen, uint count) +{ + struct video_osd_ops *ops = video_osd_get_ops(dev); + + return ops->set_mem(dev, col, row, buf, buflen, count); +} + +int video_osd_set_size(struct udevice *dev, uint col, uint row) +{ + struct video_osd_ops *ops = video_osd_get_ops(dev); + + return ops->set_size(dev, col, row); +} + +int video_osd_print(struct udevice *dev, uint col, uint row, ulong color, + char *text) +{ + struct video_osd_ops *ops = video_osd_get_ops(dev); + + return ops->print(dev, col, row, color, text); +} + +UCLASS_DRIVER(video_osd) = { + .id = UCLASS_VIDEO_OSD, + .name = "video_osd", + .flags = DM_UC_FLAG_SEQ_ALIAS, +}; |