From: Johannes Berg <johannes@sipsolutions.net>
To: Dmitry Torokhov <dtor@mail.ru>
Cc: Arjan van de Ven <arjan@infradead.org>,
linux-input <linux-input@vger.kernel.org>
Subject: [PATCH] input: input: stop autorepeat timer on key release
Date: Tue, 06 Jan 2009 12:26:24 +0100 [thread overview]
Message-ID: <1231241184.3684.1.camel@johannes> (raw)
Whenever you press and then release a key, the CPU wakes up
three times:
* press
* release
* autorepeat timer exactly 250ms after press
The autorepeat timer has nothing to do, obviously, since you already
have released the key, so stop it on key release.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Arjan van de Ven <arjan@infradead.org>
---
drivers/input/input.c | 7 +++++++
1 file changed, 7 insertions(+)
--- wireless-testing.orig/drivers/input/input.c 2009-01-06 12:15:56.000000000 +0100
+++ wireless-testing/drivers/input/input.c 2009-01-06 12:17:13.000000000 +0100
@@ -132,6 +132,11 @@ static void input_start_autorepeat(struc
}
}
+static void input_stop_autorepeat(struct input_dev *dev)
+{
+ del_timer(&dev->timer);
+}
+
#define INPUT_IGNORE_EVENT 0
#define INPUT_PASS_TO_HANDLERS 1
#define INPUT_PASS_TO_DEVICE 2
@@ -167,6 +172,8 @@ static void input_handle_event(struct in
__change_bit(code, dev->key);
if (value)
input_start_autorepeat(dev, code);
+ else
+ input_stop_autorepeat(dev);
}
disposition = INPUT_PASS_TO_HANDLERS;
next reply other threads:[~2009-01-06 13:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-06 11:26 Johannes Berg [this message]
2009-01-12 7:36 ` [PATCH] input: input: stop autorepeat timer on key release Dmitry Torokhov
2009-01-12 8:51 ` Johannes Berg
2009-01-13 5:02 ` Dmitry Torokhov
2009-01-13 8:56 ` Johannes Berg
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=1231241184.3684.1.camel@johannes \
--to=johannes@sipsolutions.net \
--cc=arjan@infradead.org \
--cc=dtor@mail.ru \
--cc=linux-input@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).