From owner-freebsd-current@FreeBSD.ORG Thu Aug 5 06:10:04 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CC4116A4CE for ; Thu, 5 Aug 2004 06:10:04 +0000 (GMT) Received: from ylpvm01.prodigy.net (ylpvm01-ext.prodigy.net [207.115.57.32]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCE0C43D4C for ; Thu, 5 Aug 2004 06:10:03 +0000 (GMT) (envelope-from mbsd@pacbell.net) Received: from sotec.home (adsl-66-126-169-219.dsl.snfc21.pacbell.net [66.126.169.219])i756A07x018580; Thu, 5 Aug 2004 02:10:01 -0400 Date: Wed, 4 Aug 2004 23:10:01 -0700 (PDT) From: =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= X-X-Sender: mikko@sotec.home To: "Alexandre \"Sunny\" Kovalenko" In-Reply-To: <1091671902.698.4.camel@RabbitsDen> Message-ID: <20040804230815.R695@sotec.home> References: <200408042100.i74L0PiQ056577@bunrab.catwhisker.org> <1091671902.698.4.camel@RabbitsDen> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: freebsd-current@freebsd.org Subject: Re: Challenge getting touchpad to work since src/sys/isa/psm.c 1.71 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2004 06:10:04 -0000 On Wed, 4 Aug 2004, Alexandre "Sunny" Kovalenko wrote: > On Wed, 2004-08-04 at 17:00, David Wolfskill wrote: >> Sorry about the delay; right around the time of the commit, I was having >> some thermal issues with my laptop (a Dell Inspiron 5000e). I believe >> those are fixed now -- it's gone through 5 days, each of which has >> involved a "buildworld cycle" for each of -STABLE & -CURRENT, without >> incident. >> >> But I'm now having trouble getting a "touchpad tap" to be recognized as >> a press/release of a mouse button in -CURRENT; I believe that the recent >> commit to src/sys/isa/psm.c 1.71 is involved. > Rolling psm.c back to 1.70 restores tapping behavior of the touchpad on > my AVERATEC 3150H. Unfortunately with 200+ lines of diff, I could not > come up with the better idea at the moment. > > I can test patches or try out settings if necessary. Here is what I'm using: $.02, /Mikko --- psm.c.orig Wed Aug 4 22:34:32 2004 +++ psm.c Wed Aug 4 22:34:38 2004 @@ -103,6 +103,13 @@ #define PSM_INPUT_TIMEOUT 2000000 /* 2 sec */ #endif +#ifndef PSM_TAP_TIMEOUT +#define PSM_TAP_TIMEOUT 125000 +#endif +#ifndef PSM_TAP_THRESHOLD +#define PSM_TAP_THRESHOLD 25 +#endif + /* end of driver specific options */ #define PSM_DRIVER_NAME "psm" @@ -181,6 +188,8 @@ struct cdev *bdev; int lasterr; int cmdcount; + struct timeval taptimeout; /* (Synaptics) width of a "tap" pulse */ + int zmax; /* (Synaptics) pressure measured during tap */ }; static devclass_t psm_devclass; #define PSM_SOFTC(unit) ((struct psm_softc*)devclass_get_softc(psm_devclass, unit)) @@ -2531,11 +2540,20 @@ } else { sc->flags |= PSM_FLAGS_FINGERDOWN; } - + sc->zmax = imax(z, sc->zmax); sc->xold = x0; sc->yold = y0; } else { sc->flags &= ~PSM_FLAGS_FINGERDOWN; + sc->flags &= ~PSM_FLAGS_FINGERDOWN; + if (sc->zmax > PSM_TAP_THRESHOLD + && timevalcmp(&sc->lastsoftintr, &sc->taptimeout, <=)) { + ms.button |= MOUSE_BUTTON1DOWN; + } + sc->zmax = 0; + sc->taptimeout.tv_sec = PSM_TAP_TIMEOUT / 1000000; + sc->taptimeout.tv_usec = PSM_TAP_TIMEOUT % 1000000; + timevaladd(&sc->taptimeout, &sc->lastsoftintr); } z = 0; break;