xref: /OK3568_Linux_fs/u-boot/drivers/input/rc-uclass.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * (C) Copyright 2017 Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6 
7 #include <dm.h>
8 #include <rc.h>
9 
rc_get_keycode(struct udevice * dev)10 int rc_get_keycode(struct udevice *dev)
11 {
12 	const struct dm_rc_ops *ops = dev_get_driver_ops(dev);
13 
14 	if (!ops || !ops->get_keycode)
15 		return -ENOSYS;
16 
17 	return ops->get_keycode(dev);
18 }
19 
rc_get_repeat(struct udevice * dev)20 int rc_get_repeat(struct udevice *dev)
21 {
22 	const struct dm_rc_ops *ops = dev_get_driver_ops(dev);
23 
24 	if (!ops || !ops->get_repeat)
25 		return -ENOSYS;
26 
27 	return ops->get_repeat(dev);
28 }
29 
30 UCLASS_DRIVER(rc) = {
31 	.id		= UCLASS_RC,
32 	.name		= "rc",
33 };
34