15 #include <linux/export.h>
19 #include <linux/sched.h>
24 #define MAX_IR_EVENT_SIZE 512
32 static u64 available_protocols;
39 static int ir_raw_event_thread(
void *
data)
48 spin_lock_irq(&raw->
lock);
51 if (retval <
sizeof(ev)) {
57 spin_unlock_irq(&raw->
lock);
63 spin_unlock_irq(&raw->
lock);
67 handler->decode(raw->
dev, ev);
93 if (
kfifo_in(&dev->raw->kfifo, ev,
sizeof(*ev)) !=
sizeof(*ev))
123 delta = ktime_to_ns(ktime_sub(now, dev->
raw->last_event));
130 if (delta > delay || !dev->
raw->last_type)
136 ir_raw_event_reset(dev);
146 dev->
raw->last_event = now;
175 if (!dev->
raw->this_ev.duration)
176 dev->
raw->this_ev = *ev;
177 else if (ev->
pulse == dev->
raw->this_ev.pulse)
181 dev->
raw->this_ev = *ev;
203 IR_dprintk(2,
"%s idle mode\n", idle ?
"enter" :
"leave");
206 dev->
raw->this_ev.timeout =
true;
208 init_ir_raw_event(&dev->
raw->this_ev);
233 spin_unlock_irqrestore(&dev->
raw->lock, flags);
243 protocols = available_protocols;
264 dev->
raw->enabled_protocols = ~0;
273 "rc%ld", dev->
devno);
275 if (IS_ERR(dev->
raw->thread)) {
276 rc = PTR_ERR(dev->
raw->thread);
299 if (!dev || !dev->
raw)
329 available_protocols |= ir_raw_handler->
protocols;
345 available_protocols &= ~ir_raw_handler->
protocols;
361 load_mce_kbd_decode();