From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:48:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EEAE106566C; Sun, 29 Nov 2009 20:48:20 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EEEF8FC1B; Sun, 29 Nov 2009 20:48:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKmKZ6008769; Sun, 29 Nov 2009 20:48:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKmKVc008767; Sun, 29 Nov 2009 20:48:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911292048.nATKmKVc008767@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 29 Nov 2009 20:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199948 - head/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:48:20 -0000 Author: nwhitehorn Date: Sun Nov 29 20:48:19 2009 New Revision: 199948 URL: http://svn.freebsd.org/changeset/base/199948 Log: 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 Modified: head/sys/dev/usb/input/atp.c Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Sun Nov 29 20:47:43 2009 (r199947) +++ head/sys/dev/usb/input/atp.c Sun Nov 29 20:48:19 2009 (r199948) @@ -1850,6 +1850,21 @@ atp_intr(struct usb_xfer *xfer, usb_erro 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]); }