From owner-svn-src-head@FreeBSD.ORG Fri Jun 19 00:10:31 2015 Return-Path: Delivered-To: svn-src-head@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EBDA5FA; Fri, 19 Jun 2015 00:10:31 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31B6A24C; Fri, 19 Jun 2015 00:10:31 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5J0AVpk034790; Fri, 19 Jun 2015 00:10:31 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5J0AVDR034789; Fri, 19 Jun 2015 00:10:31 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201506190010.t5J0AVDR034789@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Fri, 19 Jun 2015 00:10:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284585 - 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.20 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: Fri, 19 Jun 2015 00:10:31 -0000 Author: rpaulo Date: Fri Jun 19 00:10:30 2015 New Revision: 284585 URL: https://svnweb.freebsd.org/changeset/base/284585 Log: Synaptics: fix a problem with trackpoint passthrough. There was a inconsistency which led to enable passthrough commands being interpreted as actual touchpad commands. Submitted by: Jan Kokemüller MFC after: 1 week Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Fri Jun 19 00:00:32 2015 (r284584) +++ head/sys/dev/atkbdc/psm.c Fri Jun 19 00:10:30 2015 (r284585) @@ -4839,9 +4839,7 @@ enable_synaptics(struct psm_softc *sc, e synaptics_set_mode(sc, synaptics_preferred_mode(sc)); if (trackpoint_support && synhw.capPassthrough) { - synaptics_passthrough_on(sc); enable_trackpoint(sc, arg); - synaptics_passthrough_off(sc); } VLOG(3, (LOG_DEBUG, "synaptics: END init (%d buttons)\n", buttons)); @@ -5096,16 +5094,29 @@ enable_trackpoint(struct psm_softc *sc, KBDC kbdc = sc->kbdc; int id; + /* + * If called from enable_synaptics(), make sure that passthrough + * mode is enabled so we can reach the trackpoint. + * However, passthrough mode must be disabled before setting the + * trackpoint parameters, as rackpoint_command() enables and disables + * passthrough mode on its own. + */ + if (sc->synhw.capPassthrough) + synaptics_passthrough_on(sc); + if (send_aux_command(kbdc, 0xe1) != PSM_ACK || read_aux_data(kbdc) != 0x01) - return (FALSE); + goto no_trackpoint; id = read_aux_data(kbdc); if (id < 0x01) - return (FALSE); + goto no_trackpoint; if (arg == PROBE) sc->tphw = id; if (!trackpoint_support) - return (FALSE); + goto no_trackpoint; + + if (sc->synhw.capPassthrough) + synaptics_passthrough_off(sc); if (arg == PROBE) { trackpoint_sysctl_create_tree(sc); @@ -5122,6 +5133,12 @@ enable_trackpoint(struct psm_softc *sc, set_trackpoint_parameters(sc); return (TRUE); + +no_trackpoint: + if (sc->synhw.capPassthrough) + synaptics_passthrough_off(sc); + + return (FALSE); } /* Interlink electronics VersaPad */