diff options
author | dumbbell <dumbbell@FreeBSD.org> | 2012-12-18 20:02:53 +0000 |
---|---|---|
committer | dumbbell <dumbbell@FreeBSD.org> | 2012-12-18 20:02:53 +0000 |
commit | befea5e5b6a086c87555d6a41432da09bc671e3c (patch) | |
tree | 32d08b6743d6d4bb175d81c5529670c00ab25d85 /sys/dev/atkbdc | |
parent | 5d2ad328b16221e2ef34f29310a55baa918fb61c (diff) | |
download | FreeBSD-src-befea5e5b6a086c87555d6a41432da09bc671e3c.zip FreeBSD-src-befea5e5b6a086c87555d6a41432da09bc671e3c.tar.gz |
psm: Support detection of Synaptics touchpad v7.5 and above
Starting with firmware v7.5, the "Read TouchPad Modes" ($01) and "Read
Capabilities" ($02) commands changed: previously constant bytes now
carry variable information.
We now compare those bytes to expected constants only for firmware prior
to v7.5.
Tested by: Zeus Panchenko <zeus@gnu.org.ua>
MFC after: 1 week
Diffstat (limited to 'sys/dev/atkbdc')
-rw-r--r-- | sys/dev/atkbdc/psm.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index fdc6984..7cf6508 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -239,6 +239,10 @@ typedef struct synapticspacket { #define SYNAPTICS_QUEUE_CURSOR(x) \ (x + SYNAPTICS_PACKETQUEUE) % SYNAPTICS_PACKETQUEUE +#define SYNAPTICS_VERSION_GE(synhw, major, minor) \ + ((synhw).infoMajor > (major) || \ + ((synhw).infoMajor == (major) && (synhw).infoMinor >= (minor))) + typedef struct synapticsaction { synapticspacket_t queue[SYNAPTICS_PACKETQUEUE]; int queue_len; @@ -867,7 +871,9 @@ doopen(struct psm_softc *sc, int command_byte) if (sc->hw.model == MOUSE_MODEL_SYNAPTICS) { mouse_ext_command(sc->kbdc, 1); get_mouse_status(sc->kbdc, stat, 0, 3); - if (stat[1] == 0x47 && stat[2] == 0x40) { + if ((SYNAPTICS_VERSION_GE(sc->synhw, 7, 5) || + stat[1] == 0x47) && + stat[2] == 0x40) { /* Set the mode byte -- request wmode where * available */ if (sc->synhw.capExtended) @@ -4383,7 +4389,7 @@ enable_synaptics(KBDC kbdc, struct psm_softc *sc) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); - if (status[1] != 0x47) { + if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != 0x47) { printf(" Failed to read extended capability bits\n"); return (FALSE); } @@ -4439,7 +4445,7 @@ enable_synaptics(KBDC kbdc, struct psm_softc *sc) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); - if (status[1] != 0x47) { + if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != 0x47) { printf(" Failed to read mode byte\n"); return (FALSE); } |