From owner-svn-src-head@FreeBSD.ORG Tue Dec 18 20:02:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E82D635; Tue, 18 Dec 2012 20:02:54 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DC8398FC13; Tue, 18 Dec 2012 20:02:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBIK2r16017893; Tue, 18 Dec 2012 20:02:53 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBIK2rMb017892; Tue, 18 Dec 2012 20:02:53 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201212182002.qBIK2rMb017892@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Tue, 18 Dec 2012 20:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244405 - head/sys/dev/atkbdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2012 20:02:54 -0000 Author: dumbbell Date: Tue Dec 18 20:02:53 2012 New Revision: 244405 URL: http://svnweb.freebsd.org/changeset/base/244405 Log: 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 MFC after: 1 week Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Tue Dec 18 18:34:36 2012 (r244404) +++ head/sys/dev/atkbdc/psm.c Tue Dec 18 20:02:53 2012 (r244405) @@ -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 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_s 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_s 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); }