Fwd: patch for atp driver

Rohit Grover rgrover1 at gmail.com
Sat Sep 5 06:09:37 UTC 2015


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 at gmail.com>
To: 	Hans Petter Selasky <hps at 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.


-------------- next part --------------
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. */


More information about the freebsd-drivers mailing list