Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB: IR/imon: add proper auto-repeat support

Simplified from version 1, in that hacks heisted from ati_remote2.c
aren't actually necessary, the real fix for too many repeats was
from setting too long a timer release value (200ms) on repeats in
mce mode -- this patch drops the release timeout to 33ms, matching
the input subsystem default input_dev->rep[REP_PERIOD].

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Jarod Wilson and committed by
Mauro Carvalho Chehab
db190fc1 666a9ed8

+6 -5
+6 -5
drivers/media/IR/imon.c
··· 146 146 }; 147 147 148 148 #define TOUCH_TIMEOUT (HZ/30) 149 - #define MCE_TIMEOUT_MS 200 150 149 151 150 /* vfd character device file operations */ 152 151 static const struct file_operations vfd_fops = { ··· 1391 1392 unsigned char *buf, u8 ktype) 1392 1393 { 1393 1394 int press_type = 0; 1395 + int rep_delay = ictx->idev->rep[REP_DELAY]; 1396 + int rep_period = ictx->idev->rep[REP_PERIOD]; 1394 1397 1395 1398 /* key release of 0x02XXXXXX key */ 1396 1399 if (ictx->kc == KEY_RESERVED && buf[0] == 0x02 && buf[3] == 0x00) ··· 1417 1416 ictx->mce_toggle_bit = buf[2]; 1418 1417 press_type = 1; 1419 1418 mod_timer(&ictx->itimer, 1420 - jiffies + msecs_to_jiffies(MCE_TIMEOUT_MS)); 1419 + jiffies + msecs_to_jiffies(rep_delay)); 1421 1420 /* repeat */ 1422 1421 } else { 1423 1422 press_type = 2; 1424 1423 mod_timer(&ictx->itimer, 1425 - jiffies + msecs_to_jiffies(MCE_TIMEOUT_MS)); 1424 + jiffies + msecs_to_jiffies(rep_period)); 1426 1425 } 1427 1426 1428 1427 /* incoherent or irrelevant data */ ··· 1540 1539 do_gettimeofday(&t); 1541 1540 msec = tv2int(&t, &prev_time); 1542 1541 prev_time = t; 1543 - if (msec < 200) 1542 + if (msec < idev->rep[REP_DELAY]) 1544 1543 return; 1545 1544 } 1546 1545 ··· 1685 1684 strlcat(ictx->phys_idev, "/input0", sizeof(ictx->phys_idev)); 1686 1685 idev->phys = ictx->phys_idev; 1687 1686 1688 - idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); 1687 + idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | BIT_MASK(EV_REL); 1689 1688 1690 1689 idev->keybit[BIT_WORD(BTN_MOUSE)] = 1691 1690 BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_RIGHT);