diff options
author | Maxim Levitsky <maximlevitsky@gmail.com> | 2010-07-31 10:59:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-08 22:43:00 -0400 |
commit | ed4d3876d18d95406e0258a6421b1f4eda51d629 (patch) | |
tree | 17381115cf0c46fc5a7dd671e2a61ec48ac9c284 /drivers/media/IR/ir-keytable.c | |
parent | e589333f346b58f8da5bb8152e1219c52d375ccc (diff) |
V4L/DVB: IR: report unknown scancodes the in-kernel decoders found
This way it is possible to use evtest to create keymap for unknown remote.
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
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.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 411976d10f83..7032ea047f8a 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c | |||
@@ -339,6 +339,8 @@ void ir_repeat(struct input_dev *dev) | |||
339 | 339 | ||
340 | spin_lock_irqsave(&ir->keylock, flags); | 340 | spin_lock_irqsave(&ir->keylock, flags); |
341 | 341 | ||
342 | input_event(dev, EV_MSC, MSC_SCAN, ir->last_scancode); | ||
343 | |||
342 | if (!ir->keypressed) | 344 | if (!ir->keypressed) |
343 | goto out; | 345 | goto out; |
344 | 346 | ||
@@ -370,6 +372,8 @@ void ir_keydown(struct input_dev *dev, int scancode, u8 toggle) | |||
370 | 372 | ||
371 | spin_lock_irqsave(&ir->keylock, flags); | 373 | spin_lock_irqsave(&ir->keylock, flags); |
372 | 374 | ||
375 | input_event(dev, EV_MSC, MSC_SCAN, scancode); | ||
376 | |||
373 | /* Repeat event? */ | 377 | /* Repeat event? */ |
374 | if (ir->keypressed && | 378 | if (ir->keypressed && |
375 | ir->last_scancode == scancode && | 379 | ir->last_scancode == scancode && |
@@ -383,9 +387,11 @@ void ir_keydown(struct input_dev *dev, int scancode, u8 toggle) | |||
383 | ir->last_toggle = toggle; | 387 | ir->last_toggle = toggle; |
384 | ir->last_keycode = keycode; | 388 | ir->last_keycode = keycode; |
385 | 389 | ||
390 | |||
386 | if (keycode == KEY_RESERVED) | 391 | if (keycode == KEY_RESERVED) |
387 | goto out; | 392 | goto out; |
388 | 393 | ||
394 | |||
389 | /* Register a keypress */ | 395 | /* Register a keypress */ |
390 | ir->keypressed = true; | 396 | ir->keypressed = true; |
391 | IR_dprintk(1, "%s: key down event, key 0x%04x, scancode 0x%04x\n", | 397 | IR_dprintk(1, "%s: key down event, key 0x%04x, scancode 0x%04x\n", |
@@ -480,6 +486,8 @@ int __ir_input_register(struct input_dev *input_dev, | |||
480 | 486 | ||
481 | set_bit(EV_KEY, input_dev->evbit); | 487 | set_bit(EV_KEY, input_dev->evbit); |
482 | set_bit(EV_REP, input_dev->evbit); | 488 | set_bit(EV_REP, input_dev->evbit); |
489 | set_bit(EV_MSC, input_dev->evbit); | ||
490 | set_bit(MSC_SCAN, input_dev->mscbit); | ||
483 | 491 | ||
484 | if (ir_setkeytable(input_dev, &ir_dev->rc_tab, rc_tab)) { | 492 | if (ir_setkeytable(input_dev, &ir_dev->rc_tab, rc_tab)) { |
485 | rc = -ENOMEM; | 493 | rc = -ENOMEM; |