Date: Wed, 2 Jan 2013 22:14:19 +0000 (UTC) From: Jean-Sebastien Pedron <dumbbell@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r244982 - stable/8/sys/dev/atkbdc Message-ID: <201301022214.r02MEJsx074514@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dumbbell Date: Wed Jan 2 22:14:18 2013 New Revision: 244982 URL: http://svnweb.freebsd.org/changeset/base/244982 Log: MFC r244405: 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> Modified: stable/8/sys/dev/atkbdc/psm.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/atkbdc/ (props changed) Modified: stable/8/sys/dev/atkbdc/psm.c ============================================================================== --- stable/8/sys/dev/atkbdc/psm.c Wed Jan 2 22:01:26 2013 (r244981) +++ stable/8/sys/dev/atkbdc/psm.c Wed Jan 2 22:14:18 2013 (r244982) @@ -244,6 +244,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; @@ -887,7 +891,9 @@ doopen(struct psm_softc *sc, int command 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) @@ -4356,7 +4362,7 @@ enable_synaptics(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(sc->synhw, 7, 5) && status[1] != 0x47) { printf(" Failed to read extended capability bits\n"); return (FALSE); } @@ -4416,7 +4422,7 @@ enable_synaptics(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(sc->synhw, 7, 5) && status[1] != 0x47) { printf(" Failed to read mode byte\n"); return (FALSE); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301022214.r02MEJsx074514>