aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/rc-core.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/rc-core.h')
-rw-r--r--include/media/rc-core.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 2c7fbca40b69..45534da57759 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -74,6 +74,8 @@ enum rc_filter_type {
74 * @input_dev: the input child device used to communicate events to userspace 74 * @input_dev: the input child device used to communicate events to userspace
75 * @driver_type: specifies if protocol decoding is done in hardware or software 75 * @driver_type: specifies if protocol decoding is done in hardware or software
76 * @idle: used to keep track of RX state 76 * @idle: used to keep track of RX state
77 * @encode_wakeup: wakeup filtering uses IR encode API, therefore the allowed
78 * wakeup protocols is the set of all raw encoders
77 * @allowed_protocols: bitmask with the supported RC_BIT_* protocols 79 * @allowed_protocols: bitmask with the supported RC_BIT_* protocols
78 * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols 80 * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols
79 * @allowed_wakeup_protocols: bitmask with the supported RC_BIT_* wakeup protocols 81 * @allowed_wakeup_protocols: bitmask with the supported RC_BIT_* wakeup protocols
@@ -134,6 +136,7 @@ struct rc_dev {
134 struct input_dev *input_dev; 136 struct input_dev *input_dev;
135 enum rc_driver_type driver_type; 137 enum rc_driver_type driver_type;
136 bool idle; 138 bool idle;
139 bool encode_wakeup;
137 u64 allowed_protocols; 140 u64 allowed_protocols;
138 u64 enabled_protocols; 141 u64 enabled_protocols;
139 u64 allowed_wakeup_protocols; 142 u64 allowed_wakeup_protocols;
@@ -239,10 +242,11 @@ static inline void init_ir_raw_event(struct ir_raw_event *ev)
239 memset(ev, 0, sizeof(*ev)); 242 memset(ev, 0, sizeof(*ev));
240} 243}
241 244
242#define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */ 245#define IR_MAX_DURATION 500000000 /* 500 ms */
243#define US_TO_NS(usec) ((usec) * 1000) 246#define US_TO_NS(usec) ((usec) * 1000)
244#define MS_TO_US(msec) ((msec) * 1000) 247#define MS_TO_US(msec) ((msec) * 1000)
245#define MS_TO_NS(msec) ((msec) * 1000 * 1000) 248#define MS_TO_NS(msec) ((msec) * 1000 * 1000)
249#define NS_TO_US(nsec) DIV_ROUND_UP(nsec, 1000L)
246 250
247void ir_raw_event_handle(struct rc_dev *dev); 251void ir_raw_event_handle(struct rc_dev *dev);
248int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev); 252int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev);
@@ -250,6 +254,9 @@ int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type);
250int ir_raw_event_store_with_filter(struct rc_dev *dev, 254int ir_raw_event_store_with_filter(struct rc_dev *dev,
251 struct ir_raw_event *ev); 255 struct ir_raw_event *ev);
252void ir_raw_event_set_idle(struct rc_dev *dev, bool idle); 256void ir_raw_event_set_idle(struct rc_dev *dev, bool idle);
257int ir_raw_encode_scancode(u64 protocols,
258 const struct rc_scancode_filter *scancode,
259 struct ir_raw_event *events, unsigned int max);
253 260
254static inline void ir_raw_event_reset(struct rc_dev *dev) 261static inline void ir_raw_event_reset(struct rc_dev *dev)
255{ 262{