Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jun 2015 00:10:31 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r284585 - head/sys/dev/atkbdc
Message-ID:  <201506190010.t5J0AVDR034789@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <jan.kokemueller at gmail.com>
  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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506190010.t5J0AVDR034789>