mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][2.6] Fix for Toshiba laptop keyboards
@ 2003-07-22 22:37 Chris Heath
  2003-07-23 15:46 ` Vojtech Pavlik
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Heath @ 2003-07-22 22:37 UTC (permalink / raw)
  To: vojtech; +Cc: linux-kernel

Here is a patch that fixes the problem we've seen on Toshiba laptop
keyboards.

It has been tested on my regular keyboard, and Ralf Hildebrandt has
confirmed that it fixes the problem on his Toshiba.

Chris


--- a/drivers/input/serio/i8042.c	2003-06-01 09:56:28.000000000 -0400
+++ b/drivers/input/serio/i8042.c	2003-07-21 22:19:53.000000000 -0400
@@ -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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-23 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-22 22:37 [PATCH][2.6] Fix for Toshiba laptop keyboards Chris Heath
2003-07-23 15:46 ` Vojtech Pavlik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®