diff options
Diffstat (limited to 'drivers/media/IR/ir-keytable.c')
-rw-r--r-- | drivers/media/IR/ir-keytable.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 8097561ec66f..b2d498c3183a 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c | |||
@@ -89,6 +89,8 @@ EXPORT_SYMBOL_GPL(ir_roundup_tablesize); | |||
89 | * @origin: origin table | 89 | * @origin: origin table |
90 | * | 90 | * |
91 | * Copies all entries where the keycode is not KEY_UNKNOWN/KEY_RESERVED | 91 | * Copies all entries where the keycode is not KEY_UNKNOWN/KEY_RESERVED |
92 | * Also copies table size and table protocol. | ||
93 | * NOTE: It shouldn't copy the lock field | ||
92 | */ | 94 | */ |
93 | 95 | ||
94 | int ir_copy_table(struct ir_scancode_table *destin, | 96 | int ir_copy_table(struct ir_scancode_table *destin, |
@@ -105,6 +107,7 @@ int ir_copy_table(struct ir_scancode_table *destin, | |||
105 | j++; | 107 | j++; |
106 | } | 108 | } |
107 | destin->size = j; | 109 | destin->size = j; |
110 | destin->ir_type = origin->ir_type; | ||
108 | 111 | ||
109 | IR_dprintk(1, "Copied %d scancodes to the new keycode table\n", destin->size); | 112 | IR_dprintk(1, "Copied %d scancodes to the new keycode table\n", destin->size); |
110 | 113 | ||
@@ -404,7 +407,8 @@ EXPORT_SYMBOL_GPL(ir_g_keycode_from_table); | |||
404 | * It should be called before registering the IR device. | 407 | * It should be called before registering the IR device. |
405 | */ | 408 | */ |
406 | int ir_input_register(struct input_dev *input_dev, | 409 | int ir_input_register(struct input_dev *input_dev, |
407 | struct ir_scancode_table *rc_tab) | 410 | const struct ir_scancode_table *rc_tab, |
411 | const struct ir_dev_props *props) | ||
408 | { | 412 | { |
409 | struct ir_input_dev *ir_dev; | 413 | struct ir_input_dev *ir_dev; |
410 | struct ir_scancode *keymap = rc_tab->scan; | 414 | struct ir_scancode *keymap = rc_tab->scan; |
@@ -417,7 +421,7 @@ int ir_input_register(struct input_dev *input_dev, | |||
417 | if (!ir_dev) | 421 | if (!ir_dev) |
418 | return -ENOMEM; | 422 | return -ENOMEM; |
419 | 423 | ||
420 | spin_lock_init(&rc_tab->lock); | 424 | spin_lock_init(&ir_dev->rc_tab.lock); |
421 | 425 | ||
422 | ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size); | 426 | ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size); |
423 | ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size * | 427 | ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size * |
@@ -430,6 +434,7 @@ int ir_input_register(struct input_dev *input_dev, | |||
430 | ir_dev->rc_tab.size * sizeof(ir_dev->rc_tab.scan)); | 434 | ir_dev->rc_tab.size * sizeof(ir_dev->rc_tab.scan)); |
431 | 435 | ||
432 | ir_copy_table(&ir_dev->rc_tab, rc_tab); | 436 | ir_copy_table(&ir_dev->rc_tab, rc_tab); |
437 | ir_dev->props = props; | ||
433 | 438 | ||
434 | /* set the bits for the keys */ | 439 | /* set the bits for the keys */ |
435 | IR_dprintk(1, "key map size: %d\n", rc_tab->size); | 440 | IR_dprintk(1, "key map size: %d\n", rc_tab->size); |