public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marko Macek <Marko.Macek@gmx.net>
To: linux-kernel@vger.kernel.org
Cc: Vojtech Pavlik <vojtech@suse.cz>
Subject: [PATCH] drivers/usb/input/ati_remote.c: autorepeat fix
Date: Wed, 05 Jul 2006 06:33:01 +0200	[thread overview]
Message-ID: <44AB40FD.10006@gmx.net> (raw)

When HZ is set to 250 (new default) or 100, the time span during which repeated
events from the device are ignored could be too small due to ms->jiffies rounding. 
This causes the auto repeat to kick in early making it impossible for the user 
to generate individual press/release events. Increate the timeout to compensate.

Signed-off-by: marko.macek@gmx.net	

---

--- linux-2.6.17.orig/drivers/usb/input/ati_remote.c	2006-06-29 21:18:15.000000000 +0200
+++ linux-2.6.17/drivers/usb/input/ati_remote.c	2006-07-02 21:36:14.000000000 +0200
@@ -155,9 +155,8 @@
  * events. The hardware generates 5 events for the first keypress
  * and we have to take this into account for an accurate repeat
  * behaviour.
- * (HZ / 20) == 50 ms and works well for me.
  */
-#define FILTER_TIME (HZ / 20)
+#define FILTER_TIME 60 /* msec */
 
 struct ati_remote {
 	struct input_dev *idev;
@@ -470,7 +469,7 @@
 		/* Filter duplicate events which happen "too close" together. */
 		if ((ati_remote->old_data[0] == data[1]) &&
 			(ati_remote->old_data[1] == data[2]) &&
-			time_before(jiffies, ati_remote->old_jiffies + FILTER_TIME)) {
+			time_before(jiffies, ati_remote->old_jiffies + msecs_to_jiffies(FILTER_TIME))) {
 			ati_remote->repeat_count++;
 		} else {
 			ati_remote->repeat_count = 0;



                 reply	other threads:[~2006-07-05  4:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44AB40FD.10006@gmx.net \
    --to=marko.macek@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox