summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2003-07-31 02:16:20 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:01:07 +0200
commit67ae294551dcb8ac9d9bc4b4cb914c0e008c3db8 (patch)
treeba0cc42699c278fce574e4a44c38e8acc8d79bb4
parent1d47626058ac32d07d08a73bdf1f6d3d19bf71c3 (diff)
Disable stream mode before trying to identify/initialize the
touchpad. Otherwise the touchpad can report motion data in the middle of the initialization sequence, which will confuse the driver and make the initialization fail.
-rw-r--r--ps2comm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ps2comm.c b/ps2comm.c
index d2aa9dc..ae58a20 100644
--- a/ps2comm.c
+++ b/ps2comm.c
@@ -376,10 +376,24 @@ SynapticsEnableDevice(int fd)
}
Bool
+SynapticsDisableDevice(int fd)
+{
+ xf86FlushInput(fd);
+ return ps2_putbyte(fd, PS2_CMD_DISABLE);
+}
+
+Bool
QueryIsSynaptics(int fd)
{
unsigned long id;
+ int i;
+
+ for (i = 0; i < 3; i++) {
+ if (SynapticsDisableDevice(fd) == Success)
+ break;
+ }
+ xf86WaitForInput(fd, 20000);
xf86FlushInput(fd);
if(synaptics_identify(fd, &id) == Success) {
return TRUE;