aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2011-06-04 13:14:41 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-06-11 08:04:24 -0400
commit94215ccd99eb6e3c8a035c06984630bd7479d963 (patch)
tree706bec662dfb702687ca116e3854b8beba5bd924 /drivers/media
parent443b391900469f2c5ec5a354ce305000096a94b7 (diff)
[media] imon: fix initial panel key repeat suppression
As pointed out on the lirc list by Andreas Dick, initial panel key repeat suppression wasn't working, as we had no timevals accumulated until after the first repeat. Also add a missing locking call. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/rc/imon.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index 43344fd67130..7136582a8573 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -1590,16 +1590,16 @@ static void imon_incoming_packet(struct imon_context *ictx,
1590 /* Only panel type events left to process now */ 1590 /* Only panel type events left to process now */
1591 spin_lock_irqsave(&ictx->kc_lock, flags); 1591 spin_lock_irqsave(&ictx->kc_lock, flags);
1592 1592
1593 do_gettimeofday(&t);
1593 /* KEY_MUTE repeats from knob need to be suppressed */ 1594 /* KEY_MUTE repeats from knob need to be suppressed */
1594 if (ictx->kc == KEY_MUTE && ictx->kc == ictx->last_keycode) { 1595 if (ictx->kc == KEY_MUTE && ictx->kc == ictx->last_keycode) {
1595 do_gettimeofday(&t);
1596 msec = tv2int(&t, &prev_time); 1596 msec = tv2int(&t, &prev_time);
1597 prev_time = t;
1598 if (msec < ictx->idev->rep[REP_DELAY]) { 1597 if (msec < ictx->idev->rep[REP_DELAY]) {
1599 spin_unlock_irqrestore(&ictx->kc_lock, flags); 1598 spin_unlock_irqrestore(&ictx->kc_lock, flags);
1600 return; 1599 return;
1601 } 1600 }
1602 } 1601 }
1602 prev_time = t;
1603 kc = ictx->kc; 1603 kc = ictx->kc;
1604 1604
1605 spin_unlock_irqrestore(&ictx->kc_lock, flags); 1605 spin_unlock_irqrestore(&ictx->kc_lock, flags);
@@ -1611,7 +1611,9 @@ static void imon_incoming_packet(struct imon_context *ictx,
1611 input_report_key(ictx->idev, kc, 0); 1611 input_report_key(ictx->idev, kc, 0);
1612 input_sync(ictx->idev); 1612 input_sync(ictx->idev);
1613 1613
1614 spin_lock_irqsave(&ictx->kc_lock, flags);
1614 ictx->last_keycode = kc; 1615 ictx->last_keycode = kc;
1616 spin_unlock_irqrestore(&ictx->kc_lock, flags);
1615 1617
1616 return; 1618 return;
1617 1619