Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 1 | /* ir-raw-event.c - handle IR Pulse/Space event |
| 2 | * |
| 3 | * Copyright (C) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation version 2 of the License. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | */ |
| 14 | |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 15 | #include <linux/kthread.h> |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 16 | #include <linux/mutex.h> |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 17 | #include <linux/sched.h> |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 18 | #include <linux/freezer.h> |
Mauro Carvalho Chehab | 3f113e3 | 2010-04-08 15:10:27 -0300 | [diff] [blame] | 19 | #include "ir-core-priv.h" |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 20 | |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 21 | /* Define the max number of pulse/space transitions to buffer */ |
| 22 | #define MAX_IR_EVENT_SIZE 512 |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 23 | |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 24 | /* Used to keep track of IR raw clients, protected by ir_raw_handler_lock */ |
| 25 | static LIST_HEAD(ir_raw_client_list); |
| 26 | |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 27 | /* Used to handle IR raw handler extensions */ |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 28 | static DEFINE_MUTEX(ir_raw_handler_lock); |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 29 | static LIST_HEAD(ir_raw_handler_list); |
| 30 | static u64 available_protocols; |
Mauro Carvalho Chehab | 93c312f | 2010-03-25 21:13:43 -0300 | [diff] [blame] | 31 | |
Mauro Carvalho Chehab | 5fa2989 | 2010-04-08 19:04:06 -0300 | [diff] [blame] | 32 | #ifdef MODULE |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 33 | /* Used to load the decoders */ |
| 34 | static struct work_struct wq_load; |
Mauro Carvalho Chehab | 5fa2989 | 2010-04-08 19:04:06 -0300 | [diff] [blame] | 35 | #endif |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 36 | |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 37 | static int ir_raw_event_thread(void *data) |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 38 | { |
David Härdeman | e40b112 | 2010-04-15 18:46:00 -0300 | [diff] [blame] | 39 | struct ir_raw_event ev; |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 40 | struct ir_raw_handler *handler; |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 41 | struct ir_raw_event_ctrl *raw = (struct ir_raw_event_ctrl *)data; |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 42 | |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 43 | while (!kthread_should_stop()) { |
| 44 | try_to_freeze(); |
| 45 | |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 46 | mutex_lock(&ir_raw_handler_lock); |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 47 | |
| 48 | while (kfifo_out(&raw->kfifo, &ev, sizeof(ev)) == sizeof(ev)) { |
| 49 | list_for_each_entry(handler, &ir_raw_handler_list, list) |
| 50 | handler->decode(raw->input_dev, ev); |
| 51 | raw->prev_ev = ev; |
| 52 | } |
| 53 | |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 54 | mutex_unlock(&ir_raw_handler_lock); |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 55 | |
| 56 | set_current_state(TASK_INTERRUPTIBLE); |
| 57 | schedule(); |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 58 | } |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 59 | |
| 60 | return 0; |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 61 | } |
| 62 | |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 63 | /** |
| 64 | * ir_raw_event_store() - pass a pulse/space duration to the raw ir decoders |
| 65 | * @input_dev: the struct input_dev device descriptor |
David Härdeman | e40b112 | 2010-04-15 18:46:00 -0300 | [diff] [blame] | 66 | * @ev: the struct ir_raw_event descriptor of the pulse/space |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 67 | * |
| 68 | * This routine (which may be called from an interrupt context) stores a |
| 69 | * pulse/space duration for the raw ir decoding state machines. Pulses are |
| 70 | * signalled as positive values and spaces as negative values. A zero value |
| 71 | * will reset the decoding state machines. |
| 72 | */ |
David Härdeman | e40b112 | 2010-04-15 18:46:00 -0300 | [diff] [blame] | 73 | int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev) |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 74 | { |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 75 | struct ir_input_dev *ir = input_get_drvdata(input_dev); |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 76 | |
| 77 | if (!ir->raw) |
| 78 | return -EINVAL; |
| 79 | |
Maxim Levitsky | 510fcb7 | 2010-07-31 11:59:15 -0300 | [diff] [blame] | 80 | IR_dprintk(2, "sample: (05%dus %s)\n", |
| 81 | TO_US(ev->duration), TO_STR(ev->pulse)); |
| 82 | |
David Härdeman | e40b112 | 2010-04-15 18:46:00 -0300 | [diff] [blame] | 83 | if (kfifo_in(&ir->raw->kfifo, ev, sizeof(*ev)) != sizeof(*ev)) |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 84 | return -ENOMEM; |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 85 | |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 86 | return 0; |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 87 | } |
| 88 | EXPORT_SYMBOL_GPL(ir_raw_event_store); |
| 89 | |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 90 | /** |
| 91 | * ir_raw_event_store_edge() - notify raw ir decoders of the start of a pulse/space |
| 92 | * @input_dev: the struct input_dev device descriptor |
| 93 | * @type: the type of the event that has occurred |
| 94 | * |
| 95 | * This routine (which may be called from an interrupt context) is used to |
| 96 | * store the beginning of an ir pulse or space (or the start/end of ir |
| 97 | * reception) for the raw ir decoding state machines. This is used by |
| 98 | * hardware which does not provide durations directly but only interrupts |
| 99 | * (or similar events) on state change. |
| 100 | */ |
| 101 | int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type) |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 102 | { |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 103 | struct ir_input_dev *ir = input_get_drvdata(input_dev); |
| 104 | ktime_t now; |
| 105 | s64 delta; /* ns */ |
David Härdeman | e40b112 | 2010-04-15 18:46:00 -0300 | [diff] [blame] | 106 | struct ir_raw_event ev; |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 107 | int rc = 0; |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 108 | |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 109 | if (!ir->raw) |
| 110 | return -EINVAL; |
| 111 | |
| 112 | now = ktime_get(); |
| 113 | delta = ktime_to_ns(ktime_sub(now, ir->raw->last_event)); |
| 114 | |
| 115 | /* Check for a long duration since last event or if we're |
| 116 | * being called for the first time, note that delta can't |
| 117 | * possibly be negative. |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 118 | */ |
David Härdeman | e40b112 | 2010-04-15 18:46:00 -0300 | [diff] [blame] | 119 | ev.duration = 0; |
| 120 | if (delta > IR_MAX_DURATION || !ir->raw->last_type) |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 121 | type |= IR_START_EVENT; |
David Härdeman | e40b112 | 2010-04-15 18:46:00 -0300 | [diff] [blame] | 122 | else |
| 123 | ev.duration = delta; |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 124 | |
| 125 | if (type & IR_START_EVENT) |
| 126 | ir_raw_event_reset(input_dev); |
David Härdeman | e40b112 | 2010-04-15 18:46:00 -0300 | [diff] [blame] | 127 | else if (ir->raw->last_type & IR_SPACE) { |
| 128 | ev.pulse = false; |
| 129 | rc = ir_raw_event_store(input_dev, &ev); |
| 130 | } else if (ir->raw->last_type & IR_PULSE) { |
| 131 | ev.pulse = true; |
| 132 | rc = ir_raw_event_store(input_dev, &ev); |
| 133 | } else |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 134 | return 0; |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 135 | |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 136 | ir->raw->last_event = now; |
| 137 | ir->raw->last_type = type; |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 138 | return rc; |
| 139 | } |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 140 | EXPORT_SYMBOL_GPL(ir_raw_event_store_edge); |
| 141 | |
| 142 | /** |
| 143 | * ir_raw_event_handle() - schedules the decoding of stored ir data |
| 144 | * @input_dev: the struct input_dev device descriptor |
| 145 | * |
| 146 | * This routine will signal the workqueue to start decoding stored ir data. |
| 147 | */ |
| 148 | void ir_raw_event_handle(struct input_dev *input_dev) |
| 149 | { |
| 150 | struct ir_input_dev *ir = input_get_drvdata(input_dev); |
| 151 | |
| 152 | if (!ir->raw) |
| 153 | return; |
| 154 | |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 155 | wake_up_process(ir->raw->thread); |
David Härdeman | 724e249 | 2010-04-08 13:10:00 -0300 | [diff] [blame] | 156 | } |
Mauro Carvalho Chehab | a3572c3 | 2010-03-20 20:59:44 -0300 | [diff] [blame] | 157 | EXPORT_SYMBOL_GPL(ir_raw_event_handle); |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 158 | |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 159 | /* used internally by the sysfs interface */ |
| 160 | u64 |
| 161 | ir_raw_get_allowed_protocols() |
| 162 | { |
| 163 | u64 protocols; |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 164 | mutex_lock(&ir_raw_handler_lock); |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 165 | protocols = available_protocols; |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 166 | mutex_unlock(&ir_raw_handler_lock); |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 167 | return protocols; |
| 168 | } |
| 169 | |
| 170 | /* |
| 171 | * Used to (un)register raw event clients |
| 172 | */ |
| 173 | int ir_raw_event_register(struct input_dev *input_dev) |
| 174 | { |
| 175 | struct ir_input_dev *ir = input_get_drvdata(input_dev); |
| 176 | int rc; |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 177 | struct ir_raw_handler *handler; |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 178 | |
| 179 | ir->raw = kzalloc(sizeof(*ir->raw), GFP_KERNEL); |
| 180 | if (!ir->raw) |
| 181 | return -ENOMEM; |
| 182 | |
| 183 | ir->raw->input_dev = input_dev; |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 184 | |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 185 | ir->raw->enabled_protocols = ~0; |
| 186 | rc = kfifo_alloc(&ir->raw->kfifo, sizeof(s64) * MAX_IR_EVENT_SIZE, |
| 187 | GFP_KERNEL); |
| 188 | if (rc < 0) { |
| 189 | kfree(ir->raw); |
| 190 | ir->raw = NULL; |
| 191 | return rc; |
| 192 | } |
| 193 | |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 194 | ir->raw->thread = kthread_run(ir_raw_event_thread, ir->raw, |
| 195 | "rc%u", (unsigned int)ir->devno); |
| 196 | |
| 197 | if (IS_ERR(ir->raw->thread)) { |
| 198 | kfree(ir->raw); |
| 199 | ir->raw = NULL; |
| 200 | return PTR_ERR(ir->raw->thread); |
| 201 | } |
| 202 | |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 203 | mutex_lock(&ir_raw_handler_lock); |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 204 | list_add_tail(&ir->raw->list, &ir_raw_client_list); |
| 205 | list_for_each_entry(handler, &ir_raw_handler_list, list) |
| 206 | if (handler->raw_register) |
| 207 | handler->raw_register(ir->raw->input_dev); |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 208 | mutex_unlock(&ir_raw_handler_lock); |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 209 | |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 210 | return 0; |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 211 | } |
| 212 | |
| 213 | void ir_raw_event_unregister(struct input_dev *input_dev) |
| 214 | { |
| 215 | struct ir_input_dev *ir = input_get_drvdata(input_dev); |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 216 | struct ir_raw_handler *handler; |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 217 | |
| 218 | if (!ir->raw) |
| 219 | return; |
| 220 | |
Maxim Levitsky | 0d2cb1d | 2010-07-31 11:59:17 -0300 | [diff] [blame^] | 221 | kthread_stop(ir->raw->thread); |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 222 | |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 223 | mutex_lock(&ir_raw_handler_lock); |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 224 | list_del(&ir->raw->list); |
| 225 | list_for_each_entry(handler, &ir_raw_handler_list, list) |
| 226 | if (handler->raw_unregister) |
| 227 | handler->raw_unregister(ir->raw->input_dev); |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 228 | mutex_unlock(&ir_raw_handler_lock); |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 229 | |
| 230 | kfifo_free(&ir->raw->kfifo); |
| 231 | kfree(ir->raw); |
| 232 | ir->raw = NULL; |
| 233 | } |
| 234 | |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 235 | /* |
| 236 | * Extension interface - used to register the IR decoders |
| 237 | */ |
| 238 | |
| 239 | int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler) |
| 240 | { |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 241 | struct ir_raw_event_ctrl *raw; |
| 242 | |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 243 | mutex_lock(&ir_raw_handler_lock); |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 244 | list_add_tail(&ir_raw_handler->list, &ir_raw_handler_list); |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 245 | if (ir_raw_handler->raw_register) |
| 246 | list_for_each_entry(raw, &ir_raw_client_list, list) |
| 247 | ir_raw_handler->raw_register(raw->input_dev); |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 248 | available_protocols |= ir_raw_handler->protocols; |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 249 | mutex_unlock(&ir_raw_handler_lock); |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 250 | |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 251 | return 0; |
| 252 | } |
| 253 | EXPORT_SYMBOL(ir_raw_handler_register); |
| 254 | |
| 255 | void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler) |
| 256 | { |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 257 | struct ir_raw_event_ctrl *raw; |
| 258 | |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 259 | mutex_lock(&ir_raw_handler_lock); |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 260 | list_del(&ir_raw_handler->list); |
David Härdeman | c216369 | 2010-06-13 17:29:36 -0300 | [diff] [blame] | 261 | if (ir_raw_handler->raw_unregister) |
| 262 | list_for_each_entry(raw, &ir_raw_client_list, list) |
| 263 | ir_raw_handler->raw_unregister(raw->input_dev); |
David Härdeman | 667c9eb | 2010-06-13 17:29:31 -0300 | [diff] [blame] | 264 | available_protocols &= ~ir_raw_handler->protocols; |
Maxim Levitsky | 45a568f | 2010-07-31 11:59:16 -0300 | [diff] [blame] | 265 | mutex_unlock(&ir_raw_handler_lock); |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 266 | } |
| 267 | EXPORT_SYMBOL(ir_raw_handler_unregister); |
| 268 | |
Mauro Carvalho Chehab | 5fa2989 | 2010-04-08 19:04:06 -0300 | [diff] [blame] | 269 | #ifdef MODULE |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 270 | static void init_decoders(struct work_struct *work) |
| 271 | { |
| 272 | /* Load the decoder modules */ |
| 273 | |
| 274 | load_nec_decode(); |
Mauro Carvalho Chehab | db1423a | 2010-04-04 10:27:20 -0300 | [diff] [blame] | 275 | load_rc5_decode(); |
David Härdeman | 784a493 | 2010-04-08 20:04:40 -0300 | [diff] [blame] | 276 | load_rc6_decode(); |
David Härdeman | bf670f6 | 2010-04-15 18:46:05 -0300 | [diff] [blame] | 277 | load_jvc_decode(); |
David Härdeman | 3fe29c8 | 2010-04-15 18:46:10 -0300 | [diff] [blame] | 278 | load_sony_decode(); |
Jarod Wilson | ca41469 | 2010-07-03 01:07:53 -0300 | [diff] [blame] | 279 | load_lirc_codec(); |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 280 | |
| 281 | /* If needed, we may later add some init code. In this case, |
| 282 | it is needed to change the CONFIG_MODULE test at ir-core.h |
| 283 | */ |
| 284 | } |
Mauro Carvalho Chehab | 5fa2989 | 2010-04-08 19:04:06 -0300 | [diff] [blame] | 285 | #endif |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 286 | |
| 287 | void ir_raw_init(void) |
| 288 | { |
Mauro Carvalho Chehab | 93c312f | 2010-03-25 21:13:43 -0300 | [diff] [blame] | 289 | #ifdef MODULE |
Mauro Carvalho Chehab | 995187b | 2010-03-24 20:47:53 -0300 | [diff] [blame] | 290 | INIT_WORK(&wq_load, init_decoders); |
| 291 | schedule_work(&wq_load); |
Mauro Carvalho Chehab | 93c312f | 2010-03-25 21:13:43 -0300 | [diff] [blame] | 292 | #endif |
| 293 | } |