Re: [PATCH] Synaptics TouchPad driver for 2.5.70

Peter Osterlund
2003-06-18T23:28:23Z

Vojtech Pavlik <vojtech@suse.cz> writes:

> On Sun, Jun 15, 2003 at 05:47:57PM +0200, Peter Osterlund wrote:
> >
> > The X driver already relies on EV_SYN to decide when it should act on
> > the data from the kernel. The problem is that the packet stream is
> > used as a time base for gesture decoding, because the touchpad was
> > designed like that to make driver implementation simpler.
>
> We may switch to using some ABS_ or BNT_TOOL_ values for the gesture
> reporting if some other than Synaptics pad is reporting those, so that
> we can have one common driver. That other pad may not only not be
> sending data in a different format, but most likely will also not be
> sending the data one second after last real event.
...
> Well, I'd suggest using the timestamp on the packets and not just
> counting them, but the decision is yours, of course. The timestamp is
> very exact.

I have modified the X driver now, so that it doesn't depend on packets
arriving one second after the last event, and so that it uses wall
clock time instead of counting packets. This version therefore works
with an unpatched 2.5.72 kernel. It is available here:

http://w1.894.telia.com/~u89404340/touchpad/index.html

I think the following patch should be applied anyway. It adds a link
to the html page, fixes bogus reset retry logic and fixes a deviation
from the coding style preferred by Linus.

diff -u -r linux/drivers/input/mouse.orig/Kconfig linux/drivers/input/mouse/Kconfig
--- linux/drivers/input/mouse.orig/Kconfig 2003-06-19 01:30:39.000000000 +0200
+++ linux/drivers/input/mouse/Kconfig 2003-06-17 22:03:17.000000000 +0200
@@ -37,7 +37,7 @@
This touchpad is found on many modern laptop computers.
Note that you also need a user space driver to interpret the data
generated by the kernel. A compatible driver for XFree86 is available
- from http://...
+ from http://w1.894.telia.com/~u89404340/touchpad/index.html

If unsure, say Y.

diff -u -r linux/drivers/input/mouse.orig/synaptics.c linux/drivers/input/mouse/synaptics.c
--- linux/drivers/input/mouse.orig/synaptics.c 2003-06-19 01:30:47.000000000 +0200
+++ linux/drivers/input/mouse/synaptics.c 2003-06-17 22:06:48.000000000 +0200
@@ -171,9 +171,9 @@
static int query_hardware(struct psmouse *psmouse)
{
struct synaptics_data *priv = psmouse->private;
- int retries = 3;
+ int retries = 0;

- while ((retries++ <= 3) && synaptics_reset(psmouse))
+ while ((retries++ < 3) && synaptics_reset(psmouse))
printk(KERN_ERR "synaptics reset failed\n");

if (synaptics_identify(psmouse, &priv->identity))
@@ -266,8 +266,7 @@
* Functions to interpret the absolute mode packets
****************************************************************************/

-static void synaptics_parse_hw_state(struct synaptics_data *priv,
- struct synaptics_hw_state *hw)
+static void synaptics_parse_hw_state(struct synaptics_data *priv, struct synaptics_hw_state *hw)
{
unsigned char *buf = priv->proto_buf;

--
Peter Osterlund - petero2@telia.com