Challenge getting touchpad to work since src/sys/isa/psm.c 1.71
Mikko Työläjärvi
mbsd at pacbell.net
Wed Aug 4 23:10:04 PDT 2004
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;
More information about the freebsd-current
mailing list