summaryrefslogtreecommitdiffstats
path: root/include/media/ir-core.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-04-02 20:01:00 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 12:56:50 -0300
commit02858eedcb78a664215b918d98cdb753ce432ce6 (patch)
treedd212b7b2e63cd846a1c9cf0d9b751514648b130 /include/media/ir-core.h
parentb2245ba1644eb1eba400fd04c6e7bb3ab2d4a8fa (diff)
downloadop-kernel-dev-02858eedcb78a664215b918d98cdb753ce432ce6.zip
op-kernel-dev-02858eedcb78a664215b918d98cdb753ce432ce6.tar.gz
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 8e975f2..e1772b8 100644
--- a/include/media/ir-core.h
+++ b/include/media/ir-core.h
@@ -21,6 +21,7 @@
#include <linux/kfifo.h>
#include <linux/time.h>
#include <linux/timer.h>
+#include <media/rc-map.h>
extern int ir_core_debug;
#define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \
@@ -124,6 +125,7 @@ EXPORT_SYMBOL_GPL(IR_KEYTABLE(tabname))
int ir_register_map(struct rc_keymap *map);
void ir_unregister_map(struct rc_keymap *map);
struct ir_scancode_table *get_rc_map(const char *name);
+void rc_map_init(void);
/* Routines from ir-keytable.c */
@@ -141,15 +143,30 @@ static inline int ir_input_register(struct input_dev *dev,
const struct ir_dev_props *props,
const char *driver_name) {
struct ir_scancode_table *ir_codes;
+ struct ir_input_dev *ir_dev;
+ int rc;
+
+ if (!map_name)
+ return -EINVAL;
ir_codes = get_rc_map(map_name);
if (!ir_codes)
return -EINVAL;
- return __ir_input_register(dev, ir_codes, props, driver_name);
+ rc = __ir_input_register(dev, ir_codes, props, driver_name);
+ if (rc < 0)
+ return -EINVAL;
+
+ ir_dev = input_get_drvdata(dev);
+
+ if (!rc && ir_dev->props && ir_dev->props->change_protocol)
+ rc = ir_dev->props->change_protocol(ir_dev->props->priv,
+ ir_codes->ir_type);
+
+ return rc;
}
- void ir_input_unregister(struct input_dev *input_dev);
+void ir_input_unregister(struct input_dev *input_dev);
/* Routines from ir-sysfs.c */
OpenPOWER on IntegriCloud