From 1a1934fab0c920f0d3bceeb60c9fe2dae8a56be9 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Fri, 28 Feb 2014 20:17:03 -0300 Subject: [media] rc: abstract access to allowed/enabled protocols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The allowed and enabled protocol masks need to be expanded to be per filter type in order to support wakeup filter protocol selection. To ease that process abstract access to the rc_dev::allowed_protos and rc_dev::enabled_protocols members with inline functions. Signed-off-by: James Hogan Reviewed-by: Antti Seppälä Signed-off-by: Mauro Carvalho Chehab --- include/media/rc-core.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include/media') diff --git a/include/media/rc-core.h b/include/media/rc-core.h index 5e7197e40c14..6f3c3d977c81 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h @@ -160,6 +160,28 @@ struct rc_dev { #define to_rc_dev(d) container_of(d, struct rc_dev, dev) +static inline bool rc_protocols_allowed(struct rc_dev *rdev, u64 protos) +{ + return rdev->allowed_protos & protos; +} + +/* should be called prior to registration or with mutex held */ +static inline void rc_set_allowed_protocols(struct rc_dev *rdev, u64 protos) +{ + rdev->allowed_protos = protos; +} + +static inline bool rc_protocols_enabled(struct rc_dev *rdev, u64 protos) +{ + return rdev->enabled_protocols & protos; +} + +/* should be called prior to registration or with mutex held */ +static inline void rc_set_enabled_protocols(struct rc_dev *rdev, u64 protos) +{ + rdev->enabled_protocols = protos; +} + /* * From rc-main.c * Those functions can be used on any type of Remote Controller. They -- cgit v1.2.3