aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/ir-core.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-04-02 19:01:00 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:56:50 -0400
commit02858eedcb78a664215b918d98cdb753ce432ce6 (patch)
treedd212b7b2e63cd846a1c9cf0d9b751514648b130 /include/media/ir-core.h
parentb2245ba1644eb1eba400fd04c6e7bb3ab2d4a8fa (diff)
V4L/DVB: ir-core: Make use of the new IR keymap modules
Instead of using the ugly keymap sequences, use the new rc-*.ko keymap files. For now, it is still needed to have one keymap loaded, for the RC code to work. Later patches will remove this depenency. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/ir-core.h')
-rw-r--r--include/media/ir-core.h21
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
25extern int ir_core_debug; 26extern 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))
124int ir_register_map(struct rc_keymap *map); 125int ir_register_map(struct rc_keymap *map);
125void ir_unregister_map(struct rc_keymap *map); 126void ir_unregister_map(struct rc_keymap *map);
126struct ir_scancode_table *get_rc_map(const char *name); 127struct ir_scancode_table *get_rc_map(const char *name);
128void 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); 169void ir_input_unregister(struct input_dev *input_dev);
153 170
154/* Routines from ir-sysfs.c */ 171/* Routines from ir-sysfs.c */
155 172