aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/ir-keytable.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/IR/ir-keytable.c')
-rw-r--r--drivers/media/IR/ir-keytable.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index fcb0f0cb1fe1..99cad829a18a 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -446,6 +446,19 @@ void ir_keydown(struct input_dev *dev, int scancode)
446} 446}
447EXPORT_SYMBOL_GPL(ir_keydown); 447EXPORT_SYMBOL_GPL(ir_keydown);
448 448
449static int ir_open(struct input_dev *input_dev)
450{
451 struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
452
453 return ir_dev->props->open(ir_dev->props->priv);
454}
455
456static void ir_close(struct input_dev *input_dev)
457{
458 struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
459
460 ir_dev->props->close(ir_dev->props->priv);
461}
449 462
450/** 463/**
451 * ir_input_register() - sets the IR keycode table and add the handlers 464 * ir_input_register() - sets the IR keycode table and add the handlers
@@ -495,6 +508,10 @@ int ir_input_register(struct input_dev *input_dev,
495 508
496 ir_copy_table(&ir_dev->rc_tab, rc_tab); 509 ir_copy_table(&ir_dev->rc_tab, rc_tab);
497 ir_dev->props = props; 510 ir_dev->props = props;
511 if (props && props->open)
512 input_dev->open = ir_open;
513 if (props && props->close)
514 input_dev->close = ir_close;
498 515
499 /* set the bits for the keys */ 516 /* set the bits for the keys */
500 IR_dprintk(1, "key map size: %d\n", rc_tab->size); 517 IR_dprintk(1, "key map size: %d\n", rc_tab->size);