diff options
Diffstat (limited to 'include/media/ir-core.h')
-rw-r--r-- | include/media/ir-core.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/media/ir-core.h b/include/media/ir-core.h index 8e975f24dae1..e1772b8230c9 100644 --- a/include/media/ir-core.h +++ b/include/media/ir-core.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/kfifo.h> | 21 | #include <linux/kfifo.h> |
22 | #include <linux/time.h> | 22 | #include <linux/time.h> |
23 | #include <linux/timer.h> | 23 | #include <linux/timer.h> |
24 | #include <media/rc-map.h> | ||
24 | 25 | ||
25 | extern int ir_core_debug; | 26 | extern int ir_core_debug; |
26 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ | 27 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ |
@@ -124,6 +125,7 @@ EXPORT_SYMBOL_GPL(IR_KEYTABLE(tabname)) | |||
124 | int ir_register_map(struct rc_keymap *map); | 125 | int ir_register_map(struct rc_keymap *map); |
125 | void ir_unregister_map(struct rc_keymap *map); | 126 | void ir_unregister_map(struct rc_keymap *map); |
126 | struct ir_scancode_table *get_rc_map(const char *name); | 127 | struct ir_scancode_table *get_rc_map(const char *name); |
128 | void rc_map_init(void); | ||
127 | 129 | ||
128 | /* Routines from ir-keytable.c */ | 130 | /* Routines from ir-keytable.c */ |
129 | 131 | ||
@@ -141,15 +143,30 @@ static inline int ir_input_register(struct input_dev *dev, | |||
141 | const struct ir_dev_props *props, | 143 | const struct ir_dev_props *props, |
142 | const char *driver_name) { | 144 | const char *driver_name) { |
143 | struct ir_scancode_table *ir_codes; | 145 | struct ir_scancode_table *ir_codes; |
146 | struct ir_input_dev *ir_dev; | ||
147 | int rc; | ||
148 | |||
149 | if (!map_name) | ||
150 | return -EINVAL; | ||
144 | 151 | ||
145 | ir_codes = get_rc_map(map_name); | 152 | ir_codes = get_rc_map(map_name); |
146 | if (!ir_codes) | 153 | if (!ir_codes) |
147 | return -EINVAL; | 154 | return -EINVAL; |
148 | 155 | ||
149 | return __ir_input_register(dev, ir_codes, props, driver_name); | 156 | rc = __ir_input_register(dev, ir_codes, props, driver_name); |
157 | if (rc < 0) | ||
158 | return -EINVAL; | ||
159 | |||
160 | ir_dev = input_get_drvdata(dev); | ||
161 | |||
162 | if (!rc && ir_dev->props && ir_dev->props->change_protocol) | ||
163 | rc = ir_dev->props->change_protocol(ir_dev->props->priv, | ||
164 | ir_codes->ir_type); | ||
165 | |||
166 | return rc; | ||
150 | } | 167 | } |
151 | 168 | ||
152 | void ir_input_unregister(struct input_dev *input_dev); | 169 | void ir_input_unregister(struct input_dev *input_dev); |
153 | 170 | ||
154 | /* Routines from ir-sysfs.c */ | 171 | /* Routines from ir-sysfs.c */ |
155 | 172 | ||