Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Challenge getting touchpad to work since src/sys/isa/psm.c 1.71

0 views
Skip to first unread message

Alex.Ko...@verizon.net

unread,
Aug 4, 2004, 10:12:29 PM8/4/04
to
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.

Alexandre "Sunny" Kovalenko.


_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

mb...@pacbell.net

unread,
Aug 5, 2004, 2:10:39 AM8/5/04
to
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;

sch...@uni-paderborn.de

unread,
Aug 5, 2004, 9:50:54 AM8/5/04
to
David Wolfskill <da...@catwhisker.org> writes:

> 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.
>

> I normally run in -STABLE (booted from slice 1), and access the mouse
> via moused; the resulting command line is
>
> /usr/sbin/moused -3 -p /dev/psm0 -t auto
>
> Thus, in -STABLE, tapping the touchpad is equivalent to a press/release
> of the left mouse button (button 1); press/release for the right button
> is button 3, and both the left & right button "chorded" are used to
> simulate the middle button (button 2).
>
> Until the above-cited commit, this was also the case in -CURRENT.
>
> In an attempt to discover a bit more, I fired up moused without the -3
> flag, but with the -f ("foreground") and -d ("debug") flags, so I could
> see what the packets were when each event occurred. I see some
> differences between any two of them, but I'm managing to fail to see how
> those differences map to src/sys/sys/mouse.h's assignments.
>
> Event First generated packet (hex)
> Press/release left button 83 00 00 00 00 00 00 7f
> Press/release right button 86 00 00 00 00 00 00 7f
> Press/release both buttons 82 00 00 00 00 00 00 7f
> Touchpad tap 87 00 00 00 00 00 00 7f
>
> That leftmost byte is to be mapped by src/sys/sys/mouse.h thus:
>
> /* button */
> #define MOUSE_BUTTON1DOWN 0x0001 /* left */
> #define MOUSE_BUTTON2DOWN 0x0002 /* middle */
> #define MOUSE_BUTTON3DOWN 0x0004 /* right */
> #define MOUSE_BUTTON4DOWN 0x0008
> #define MOUSE_BUTTON5DOWN 0x0010
> #define MOUSE_BUTTON6DOWN 0x0020
> #define MOUSE_BUTTON7DOWN 0x0040
> #define MOUSE_BUTTON8DOWN 0x0080
> #define MOUSE_MAXBUTTON 31
> #define MOUSE_STDBUTTONS 0x0007 /* buttons 1-3 */
> #define MOUSE_EXTBUTTONS 0x7ffffff8 /* the others (28 of them!) */
> #define MOUSE_BUTTONS (MOUSE_STDBUTTONS | MOUSE_EXTBUTTONS)
>
>
> which seems a little confusing: moused is apparently reporting the
> touchpad tap as all 3 buttons being down.
>
> Perhaps a bit stranger, the device is now probed as having 3 buttons,
> vs. the 2 that are seen in -STABLE or that were seen in -CURRENT prior
> to the commit.
>
> Here's a cut/paste of the probe messages from recent -CURRENT, with
> PSM_DEBUG=1:
>
> Aug 4 11:22:31 localhost kernel: psm0: unable to allocate IRQ
> Aug 4 11:22:31 localhost kernel: psmcpnp0 irq 12 on acpi0
> Aug 4 11:22:31 localhost kernel: psm0: current command byte:0047
> Aug 4 11:22:31 localhost kernel: Synaptics Touchpad:
> Aug 4 11:22:31 localhost kernel: Version: 4.3
> Aug 4 11:22:31 localhost kernel: Model id: 88 58 a1
> Aug 4 11:22:31 localhost kernel: infoRot180: 1
> Aug 4 11:22:31 localhost kernel: infoPortrait: 0
> Aug 4 11:22:31 localhost kernel: infoSensor: 8
> Aug 4 11:22:31 localhost kernel: infoHardware: 44
> Aug 4 11:22:31 localhost kernel: infoNewAbs: 1
> Aug 4 11:22:31 localhost kernel: capPen: 0
> Aug 4 11:22:31 localhost kernel: infoSimplC: 1
> Aug 4 11:22:31 localhost kernel: infoGeometry: 1
> Aug 4 11:22:31 localhost kernel: Capability Bytes: 55 47 55
> Aug 4 11:22:31 localhost kernel: Mode byte set by BIOS: 41
> Aug 4 11:22:31 localhost kernel: psm0: found Synaptics Touchpad
> Aug 4 11:22:31 localhost kernel: psm0: <PS/2 Mouse> irq 12 on atkbdc0
> Aug 4 11:22:31 localhost kernel: psm0: [GIANT-LOCKED]
> Aug 4 11:22:31 localhost kernel: psm0: model Synaptics Touchpad, device ID 0-00, 3 buttons
> Aug 4 11:22:31 localhost kernel: psm0: config:00000000, flags:00000000, packet size:6
> Aug 4 11:22:31 localhost kernel: psm0: syncmask:c0, syncbits:80
>
>
> Anyone have clues? I'm not married to the idea of using moused. I
> tried running X without moused (telling X to access the mouse directly),
> and I managed to get the same behavior.
>

If you only use X you could use synaptics xfree driver that has its
parsing of the touchpad codes, you have to change in freebsd_mouse.h
the sysctl definition to match /usr/include/sys/mouse.h.

iirc after that:
gmake synaptics_drv.o
cp synaptics_drv.o /usr/X11R6/lib/X11/modules

(I am not sure about the X11 Path)


Otherwise you could simply change the line in /sys/isa/psm.c


/* If it is a Synaptics, byte 2 is 0x47. */
if (status[1] != 0x47)
return (FALSE);

to something like !=0x666;

so that the synaptics touchpad is recognized as a touchpad. (Behavior
like before the patch)


When I have time again I will look over the psm synaptics parsing to
make it better.

Arne

Alex.Ko...@verizon.net

unread,
Aug 5, 2004, 9:57:44 AM8/5/04
to
I was not able to apply this patch to psm.c 1.71. There is another
patch from Philip Paeps, which applied cleanly, and I am going to test
it shortly.

Thank you.
---
Alexandre "Sunny" Kovalenko.

0 new messages