summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2014-02-28 20:17:03 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-11 13:24:39 -0300
commit1a1934fab0c920f0d3bceeb60c9fe2dae8a56be9 (patch)
tree9ce4f9817f35063ac8a4543dc5e0908805dc4e93 /include/media
parentb8c7d915087c97a21fa415fa0e860e59739da202 (diff)
downloadop-kernel-dev-1a1934fab0c920f0d3bceeb60c9fe2dae8a56be9.zip
op-kernel-dev-1a1934fab0c920f0d3bceeb60c9fe2dae8a56be9.tar.gz
[media] rc: abstract access to allowed/enabled protocols
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 <james.hogan@imgtec.com> Reviewed-by: Antti Seppälä <a.seppala@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/rc-core.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 5e7197e..6f3c3d9 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
OpenPOWER on IntegriCloud