Re: Toshiba Satellite 2595XDVD

Pavel Machek (pavel@suse.cz)
Sat, 4 Dec 1999 09:37:59 +0100


Hi!

> > hardware problem, as I suspected, with Toshiba notebooks, are you (the
> > guy maintaining that part of the kernel) going to patch the kernel for
> > this? I mean - it's silly to fix in kernel hardware problems - but
> > hey, this is the way things work nowadays, unfortunately...
>
> Well there is one wya to help stop that, which is not to fix them.

I think that putting big ugly printk when such thing happens (I
thought it is problem with my fingers, not problem with keyboard) is
pretty fine thing to do and that following patch is reasonable.
Pavel

--- clean/drivers/char/keyboard.c Mon Nov 15 22:12:40 1999
+++ linux/drivers/char/keyboard.c Thu Dec 2 12:33:56 1999
@@ -204,6 +210,35 @@
char up_flag = down ? 0 : 0200;
char raw_mode;

+ /*
+ * Fix for Toshiba Satellites. Under some
+ * circumstances, its keyboards behave like ignoring the
+ * kbd repeat delay. This happens in conjunction with shift
+ * keys (ctrl, alt, shift) and leads to undesirable repeat
+ * of a key even if pressed briefly. Fix it by ignoring any
+ * subsequent occurence of the second identical scancode for
+ * 200 ms. IMO, this doesn't break anything on a good keyboard.
+ *
+ * Thanx to Andrei Pitis <pink@roedu.net>.
+ */
+ static int prev_scancode = 0;
+ static int stop_jiffies = 0;
+
+ /* new scancode, trigger delay */
+ if (scancode != prev_scancode)
+ stop_jiffies = jiffies;
+
+ /* same scancode, accept only after the delay */
+ else if (jiffies - stop_jiffies >= 10)
+ stop_jiffies = 0;
+
+ /* glitch! bail out... */
+ else {
+ printk( "Keyboard glitch detected, ignoring keypress\n" );
+ return;
+ }
+ prev_scancode = scancode;
+
acpi_access(acpi_kbd);

do_poke_blanked_console = 1;

-- 
I'm really pavel@ucw.cz. Look at http://195.113.31.123/~pavel.  Pavel
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/