1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2017
4  * Mario Six,  Guntermann & Drunck GmbH, mario.six@gdsys.cc
5  */
6 
7 #define LOG_CATEGORY UCLASS_VIDEO_OSD
8 
9 #include <dm.h>
10 #include <video_osd.h>
11 
video_osd_get_info(struct udevice * dev,struct video_osd_info * info)12 int video_osd_get_info(struct udevice *dev, struct video_osd_info *info)
13 {
14 	struct video_osd_ops *ops = video_osd_get_ops(dev);
15 
16 	return ops->get_info(dev, info);
17 }
18 
video_osd_set_mem(struct udevice * dev,uint col,uint row,u8 * buf,size_t buflen,uint count)19 int video_osd_set_mem(struct udevice *dev, uint col, uint row, u8 *buf,
20 		      size_t buflen, uint count)
21 {
22 	struct video_osd_ops *ops = video_osd_get_ops(dev);
23 
24 	return ops->set_mem(dev, col, row, buf, buflen, count);
25 }
26 
video_osd_set_size(struct udevice * dev,uint col,uint row)27 int video_osd_set_size(struct udevice *dev, uint col, uint row)
28 {
29 	struct video_osd_ops *ops = video_osd_get_ops(dev);
30 
31 	return ops->set_size(dev, col, row);
32 }
33 
video_osd_print(struct udevice * dev,uint col,uint row,ulong color,char * text)34 int video_osd_print(struct udevice *dev, uint col, uint row, ulong color,
35 		    char *text)
36 {
37 	struct video_osd_ops *ops = video_osd_get_ops(dev);
38 
39 	return ops->print(dev, col, row, color, text);
40 }
41 
42 UCLASS_DRIVER(video_osd) = {
43 	.id		= UCLASS_VIDEO_OSD,
44 	.name		= "video_osd",
45 	.flags		= DM_UC_FLAG_SEQ_ALIAS,
46 };
47