Re: Synaptics Touchpad workaround for strange behavior after Syncloss (With Patch).

From: Gunter Königsmann
Date: Sun Jan 11 2004 - 03:38:30 EST


Hmmm... Now I get an "Reverted to legacy aux mode" after about every third
resync of the driver, and sometimes odd and sometimes even numbers of sync
losses...

But this patch also seems to fix bad clicks, tried for some minutes, and
still got none.

On Today, Peter Berg Larsen wrote:

>From: Peter Berg Larsen <pebl@xxxxxxxxxx>
>Date: Sun, 11 Jan 2004 03:39:16 +0100 (CET)
>To: Vojtech Pavlik <vojtech@xxxxxxx>
>Delivered-To: GMX delivery to gunter.koenigsmann@xxxxxx
>Cc: Gunter Königsmann <gunter.koenigsmann@xxxxxx>,
> linux-kernel@xxxxxxxxxxxxxxx
>Subject: Re: Synaptics Touchpad workaround for strange behavior after Sync
> loss (With Patch).
>
>
>On Sat, 10 Jan 2004, Peter Berg Larsen wrote:
>
>> I dont have a machine with active multiplexing so the the patch is
>> untested. It warns when the mouse is removed, and tries to recover
>> if multiplexing is disabled.
>
>A lot a have changed since 2.6.0 so here is the patch against 2.6.1:
>
>diff -rup a/include/linux/serio.h b/include/linux/serio.h
>--- a/include/linux/serio.h Sun Oct 20 04:57:23 2002
>+++ b/include/linux/serio.h Sun Oct 20 04:58:32 2002
>@@ -99,6 +99,7 @@
> #define SERIO_TIMEOUT 1
> #define SERIO_PARITY 2
> #define SERIO_FRAME 4
>+#define SERIO_REMOVED 8
>
> #define SERIO_TYPE 0xff000000UL
> #define SERIO_XT 0x00000000UL
>diff -rup a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
>--- a/drivers/input/serio/i8042.c 2004-01-11 03:52:53.000000000 +0100
>+++ b/drivers/input/serio/i8042.c 2004-01-11 04:02:34.000000000 +0100
>@@ -78,6 +78,7 @@ struct timer_list i8042_timer;
> #define i8042_request_irq_cookie (&i8042_timer)
>
> static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs);
>+static int i8042_enable_mux_mode(struct i8042_values *values, unsigned char *mux_version);
>
> /*
> * The i8042_wait_read() and i8042_wait_write functions wait for the i8042 to
>@@ -375,7 +376,7 @@ static irqreturn_t i8042_interrupt(int i
> int data;
> int str;
> } buffer[I8042_BUFFER_SIZE];
>- int i, j = 0;
>+ int i, j = 0, mux_failed = 0;
>
> spin_lock_irqsave(&i8042_lock, flags);
>
>@@ -397,15 +398,17 @@ static irqreturn_t i8042_interrupt(int i
>
> if (str & I8042_STR_MUXERR) {
> switch (data) {
>- case 0xfd:
>+ case 0xfd: dfl = SERIO_REMOVED; break;
> case 0xfe: dfl = SERIO_TIMEOUT; break;
> case 0xff: dfl = SERIO_PARITY; break;
>+ default: mux_failed = 1;
> }
> data = 0xfe;
> } else dfl = 0;
>
>- dbg("%02x <- i8042 (interrupt, aux%d, %d%s%s)",
>+ dbg("%02x <- i8042 (interrupt, aux%d, %d%s%s%s)",
> data, (str >> 6), irq,
>+ dfl & SERIO_REMOVED ? ", removed" : "",
> dfl & SERIO_PARITY ? ", bad parity" : "",
> dfl & SERIO_TIMEOUT ? ", timeout" : "");
>
>@@ -429,6 +432,12 @@ static irqreturn_t i8042_interrupt(int i
> serio_interrupt(&i8042_kbd_port, data, dfl, regs);
> }
>
>+ if (mux_failed) {
>+ printk(KERN_ERR "i8042.c: Reverted to lagacy aux mode.\n");
>+ if (i8042_enable_mux_mode(NULL,NULL))
>+ printk(KERN_ERR "i8042.c: Failed to activate mux again.\n");
>+ }
>+
> return IRQ_RETVAL(j);
> }
>
>
>
>Peter
>
>
>

--
First Corollary of Taber's Second Law:
Machines that piss people off get murdered.
-- Pat Taber
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/