|
@@ -74,10 +74,12 @@ enum rc_filter_type {
|
|
|
* @input_dev: the input child device used to communicate events to userspace
|
|
|
* @driver_type: specifies if protocol decoding is done in hardware or software
|
|
|
* @idle: used to keep track of RX state
|
|
|
- * @allowed_protocols: bitmask with the supported RC_BIT_* protocols for each
|
|
|
- * filter type
|
|
|
- * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols for each
|
|
|
- * filter type
|
|
|
+ * @allowed_protocols: bitmask with the supported RC_BIT_* protocols
|
|
|
+ * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols
|
|
|
+ * @allowed_wakeup_protocols: bitmask with the supported RC_BIT_* wakeup protocols
|
|
|
+ * @enabled_wakeup_protocols: bitmask with the enabled RC_BIT_* wakeup protocols
|
|
|
+ * @scancode_filter: scancode filter
|
|
|
+ * @scancode_wakeup_filter: scancode wakeup filters
|
|
|
* @scanmask: some hardware decoders are not capable of providing the full
|
|
|
* scancode to the application. As this is a hardware limit, we can't do
|
|
|
* anything with it. Yet, as the same keycode table can be used with other
|
|
@@ -97,7 +99,6 @@ enum rc_filter_type {
|
|
|
* @max_timeout: maximum timeout supported by device
|
|
|
* @rx_resolution : resolution (in ns) of input sampler
|
|
|
* @tx_resolution: resolution (in ns) of output sampler
|
|
|
- * @scancode_filters: scancode filters (indexed by enum rc_filter_type)
|
|
|
* @change_protocol: allow changing the protocol used on hardware decoders
|
|
|
* @change_wakeup_protocol: allow changing the protocol used for wakeup
|
|
|
* filtering
|
|
@@ -132,8 +133,12 @@ struct rc_dev {
|
|
|
struct input_dev *input_dev;
|
|
|
enum rc_driver_type driver_type;
|
|
|
bool idle;
|
|
|
- u64 allowed_protocols[RC_FILTER_MAX];
|
|
|
- u64 enabled_protocols[RC_FILTER_MAX];
|
|
|
+ u64 allowed_protocols;
|
|
|
+ u64 enabled_protocols;
|
|
|
+ u64 allowed_wakeup_protocols;
|
|
|
+ u64 enabled_wakeup_protocols;
|
|
|
+ struct rc_scancode_filter scancode_filter;
|
|
|
+ struct rc_scancode_filter scancode_wakeup_filter;
|
|
|
u32 users;
|
|
|
u32 scanmask;
|
|
|
void *priv;
|
|
@@ -150,7 +155,6 @@ struct rc_dev {
|
|
|
u32 max_timeout;
|
|
|
u32 rx_resolution;
|
|
|
u32 tx_resolution;
|
|
|
- struct rc_scancode_filter scancode_filters[RC_FILTER_MAX];
|
|
|
int (*change_protocol)(struct rc_dev *dev, u64 *rc_type);
|
|
|
int (*change_wakeup_protocol)(struct rc_dev *dev, u64 *rc_type);
|
|
|
int (*open)(struct rc_dev *dev);
|
|
@@ -171,42 +175,6 @@ 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_protocols[RC_FILTER_NORMAL] & 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_protocols[RC_FILTER_NORMAL] = protos;
|
|
|
-}
|
|
|
-
|
|
|
-static inline bool rc_protocols_enabled(struct rc_dev *rdev, u64 protos)
|
|
|
-{
|
|
|
- return rdev->enabled_protocols[RC_FILTER_NORMAL] & 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[RC_FILTER_NORMAL] = protos;
|
|
|
-}
|
|
|
-
|
|
|
-/* should be called prior to registration or with mutex held */
|
|
|
-static inline void rc_set_allowed_wakeup_protocols(struct rc_dev *rdev,
|
|
|
- u64 protos)
|
|
|
-{
|
|
|
- rdev->allowed_protocols[RC_FILTER_WAKEUP] = protos;
|
|
|
-}
|
|
|
-
|
|
|
-/* should be called prior to registration or with mutex held */
|
|
|
-static inline void rc_set_enabled_wakeup_protocols(struct rc_dev *rdev,
|
|
|
- u64 protos)
|
|
|
-{
|
|
|
- rdev->enabled_protocols[RC_FILTER_WAKEUP] = protos;
|
|
|
-}
|
|
|
-
|
|
|
/*
|
|
|
* From rc-main.c
|
|
|
* Those functions can be used on any type of Remote Controller. They
|