Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 05 Sep 2015 07:09:33 +0100
From:      Rohit Grover <rgrover1@gmail.com>
To:        freebsd-drivers@freebsd.org
Subject:   Fwd: patch for atp driver
Message-ID:  <55EA871D.9000209@gmail.com>
In-Reply-To: <55CA26E8.6070201@gmail.com>
References:  <55CA26E8.6070201@gmail.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Hi,

Can someone help process a patch to the atp driver? See below.

thanks,


-------- Forwarded Message --------
Subject: 	patch for atp driver
Date: 	Tue, 11 Aug 2015 17:46:32 +0100
From: 	Rohit Grover <rgrover1@gmail.com>
To: 	Hans Petter Selasky <hps@bitfrost.no>

	



Hello Hans,

I'd like to submit a patch to fix an issue reported against the atp
driver. Refer to https://github.com/rgrover/freebsd-atp/issues/1.

This bug was introduced with revision *262417*
<https://svnweb.freebsd.org/base?view=revision&revision=262417>. The
original code can be seen at 
https://svnweb.freebsd.org/base/head/sys/dev/usb/input/atp.c?revision=233774&view=markup#l1788.

Kevin, the person who reported the issue, has been driving the testing
and validation effort. He confirms that the attached patch fixes the
problem. Could you please review and merge this change?

thanks,
Rohit.



[-- Attachment #2 --]
diff --git a/atp.c b/atp.c
index 832c1e6..f97d658 100644
--- a/atp.c
+++ b/atp.c
@@ -996,17 +996,16 @@ fg_interpret_sensor_data(struct atp_softc *sc, u_int data_len)
 	 * be used as pressure readings subsequently.
 	 */
 	status_bits = sc->sc_sensor_data[params->data_len - 1];
-	if (((params->prot == FG_TRACKPAD_TYPE_GEYSER3) ||
-	     (params->prot == FG_TRACKPAD_TYPE_GEYSER4))  &&
+	if ((((params->prot == FG_TRACKPAD_TYPE_GEYSER3) ||
+	      (params->prot == FG_TRACKPAD_TYPE_GEYSER4)) &&
+	     (status_bits & FG_STATUS_BASE_UPDATE)) ||
 	    ((sc->sc_state & ATP_VALID) == 0)) {
-		if (status_bits & FG_STATUS_BASE_UPDATE) {
-			memcpy(sc->sc_base_x, sc->sc_cur_x,
-			    params->n_xsensors * sizeof(*sc->sc_base_x));
-			memcpy(sc->sc_base_y, sc->sc_cur_y,
-			    params->n_ysensors * sizeof(*sc->sc_base_y));
-			sc->sc_state |= ATP_VALID;
-			return;
-		}
+	    memcpy(sc->sc_base_x, sc->sc_cur_x,
+	           params->n_xsensors * sizeof(*sc->sc_base_x));
+	    memcpy(sc->sc_base_y, sc->sc_cur_y,
+	           params->n_ysensors * sizeof(*sc->sc_base_y));
+	    sc->sc_state |= ATP_VALID;
+	    return;
 	}
 
 	/* Get pressure readings and detect p-spans for both axes. */
help

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