From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: PATCH: work around tosh keyboards
Date: Sun, 27 Jul 2003 21:29:34 +0100 [thread overview]
Message-ID: <200307272029.h6RKTYEd029859@hraefn.swansea.linux.org.uk> (raw)
These produce double ups sometimes
(Chris Heath)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.6.0-test2/drivers/input/serio/i8042.c linux-2.6.0-test2-ac1/drivers/input/serio/i8042.c
--- linux-2.6.0-test2/drivers/input/serio/i8042.c 2003-07-10 21:04:55.000000000 +0100
+++ linux-2.6.0-test2-ac1/drivers/input/serio/i8042.c 2003-07-23 15:37:45.000000000 +0100
@@ -59,6 +59,7 @@
static unsigned char i8042_initial_ctr;
static unsigned char i8042_ctr;
static unsigned char i8042_last_e0;
+static unsigned char i8042_last_release;
static unsigned char i8042_mux_open;
struct timer_list i8042_timer;
@@ -406,15 +407,22 @@
if (data > 0x7f) {
unsigned char index = (data & 0x7f) | (i8042_last_e0 << 7);
+ /* work around hardware that doubles key releases */
+ if (index == i8042_last_release) {
+ dbg("i8042 skipped double release (%d)\n", index);
+ continue;
+ }
if (index == 0xaa || index == 0xb6)
set_bit(index, i8042_unxlate_seen);
if (test_and_clear_bit(index, i8042_unxlate_seen)) {
serio_interrupt(&i8042_kbd_port, 0xf0, dfl, regs);
data = i8042_unxlate_table[data & 0x7f];
+ i8042_last_release = index;
}
} else {
set_bit(data | (i8042_last_e0 << 7), i8042_unxlate_seen);
data = i8042_unxlate_table[data];
+ i8042_last_release = 0;
}
i8042_last_e0 = (data == 0xe0);
reply other threads:[~2003-07-28 1:07 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=200307272029.h6RKTYEd029859@hraefn.swansea.linux.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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).