summaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/ir-keytable.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-04-07 04:21:46 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 17:57:02 +0200
commit626cf6979e99bf2c642456308bed7bb25a37569b (patch)
tree4a5654588a37399f9240639d75064901c8737d8c /drivers/media/IR/ir-keytable.c
parentV4L/DVB: rename sysfs remote controller devices from rcrcv to rc (diff)
downloadlinux-626cf6979e99bf2c642456308bed7bb25a37569b.tar.xz
linux-626cf6979e99bf2c642456308bed7bb25a37569b.zip
V4L/DVB: ir-core: Distinguish sysfs attributes for in-hardware and raw decoders
Some devices have in-hardware Remote Controller decoder, while others need a software decoder to get the IR code. As each software decoder can be enabled/disabled individually, allowing multiple protocol decoding capability. On the other hand, hardware decoders have a limited protocol support, often being able of decoding just one protocol each time. So, each type needs a different set of capabilities to control the supported protocol(s). Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/ir-keytable.c')
-rw-r--r--drivers/media/IR/ir-keytable.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index af7400bc906f..1fdb528737fe 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -488,11 +488,19 @@ int __ir_input_register(struct input_dev *input_dev,
if (rc < 0)
goto out_table;
+ if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW) {
+ rc = ir_raw_event_register(input_dev);
+ if (rc < 0)
+ goto out_event;
+ }
+
IR_dprintk(1, "Registered input device on %s for %s remote.\n",
driver_name, rc_tab->name);
return 0;
+out_event:
+ ir_unregister_class(input_dev);
out_table:
kfree(ir_dev->rc_tab.scan);
out_name:
@@ -509,22 +517,25 @@ EXPORT_SYMBOL_GPL(__ir_input_register);
* This routine is used to free memory and de-register interfaces.
*/
-void ir_input_unregister(struct input_dev *dev)
+void ir_input_unregister(struct input_dev *input_dev)
{
- struct ir_input_dev *ir_dev = input_get_drvdata(dev);
+ struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
struct ir_scancode_table *rc_tab;
if (!ir_dev)
return;
IR_dprintk(1, "Freed keycode table\n");
+
del_timer_sync(&ir_dev->timer_keyup);
+ if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW)
+ ir_raw_event_unregister(input_dev);
rc_tab = &ir_dev->rc_tab;
rc_tab->size = 0;
kfree(rc_tab->scan);
rc_tab->scan = NULL;
- ir_unregister_class(dev);
+ ir_unregister_class(input_dev);
kfree(ir_dev->driver_name);
kfree(ir_dev);