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

From: Arne Schwabe <schwabe_at_uni-paderborn.de>
Date: Thu, 05 Aug 2004 02:57:09 +0200
David Wolfskill <david_at_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
Received on Wed Aug 04 2004 - 22:57:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:04 UTC