summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/input
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2009-11-29 20:48:19 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2009-11-29 20:48:19 +0000
commit17403a0f8a17306b165b24b667c4a6c0579f1c83 (patch)
treedc05e5e39daa7ffa7ac7504b051e8151b59a27db /sys/dev/usb/input
parent68cb4752335844f1f796ec0f3f137d6a308b0234 (diff)
downloadFreeBSD-src-17403a0f8a17306b165b24b667c4a6c0579f1c83.zip
FreeBSD-src-17403a0f8a17306b165b24b667c4a6c0579f1c83.tar.gz
Early-generation touchpads do not send periodic calibration frames for
baseline subtraction, and are very temperature sensitive, so would slowly drift out of a calibrated state when under load. Escape this by taking the last frame before we decide that the pad is idle as a finger-free baseline. Tested on: iBook G4
Diffstat (limited to 'sys/dev/usb/input')
-rw-r--r--sys/dev/usb/input/atp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/usb/input/atp.c b/sys/dev/usb/input/atp.c
index c3aae41..1489f9c 100644
--- a/sys/dev/usb/input/atp.c
+++ b/sys/dev/usb/input/atp.c
@@ -1850,6 +1850,21 @@ atp_intr(struct usb_xfer *xfer, usb_error_t error)
sc->sc_idlecount++;
if (sc->sc_idlecount >= ATP_IDLENESS_THRESHOLD) {
DPRINTFN(ATP_LLEVEL_INFO, "idle\n");
+
+ /*
+ * Use the last frame before we go idle for
+ * calibration on pads which do not send
+ * calibration frames.
+ */
+ if (sc->sc_params->prot < ATP_PROT_GEYSER3) {
+ memcpy(sc->base_x, sc->cur_x,
+ sc->sc_params->n_xsensors *
+ sizeof(*(sc->base_x)));
+ memcpy(sc->base_y, sc->cur_y,
+ sc->sc_params->n_ysensors *
+ sizeof(*(sc->base_y)));
+ }
+
sc->sc_idlecount = 0;
usbd_transfer_start(sc->sc_xfer[ATP_RESET]);
}
OpenPOWER on IntegriCloud