[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>
This commit is contained in:
James Hogan
2014-02-28 20:17:03 -03:00
committed by Mauro Carvalho Chehab
parent b8c7d91508
commit 1a1934fab0
36 changed files with 73 additions and 50 deletions

View File

@@ -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