Re: psmouse: synaptics (2.6.0-test1|2)

From: Peter Osterlund (petero2@telia.com)
Date: Tue Jul 29 2003 - 05:59:16 EST


Nico Schottelius <nico-kernel@schottelius.org> writes:

> Peter Osterlund [Mon, Jul 28, 2003 at 09:13:49PM +0200]:
> > Nico Schottelius <nico-kernel@schottelius.org> writes:
> > > My questions:
> > > 3) how can I read /dev/misc/psaux in Linux 2.6 ?
> >
> > AFAIK, you can't.
>
> that could be a problem..
>
> > > 1) why are you implementing drivers in the kernel?
> >
> > Because the raw psaux device is no longer exposed to user space.
>
> means we _are_ obsoleted from now on...
> if that's true I'll try to help you to use code from gpm where possible.
> and I hope we can work together so we can use gpm once again.
> (and possibly develop a buffer, which is available within
> gpm and X...I am rethinking this currently)

No, gpm is not obsoleted. The kernel driver is supposed to export
enough data in the /dev/input/eventX interface. It's then up to user
space programs such as gpm or the XFree driver to do something useful
with this data.

One bonus is that the eventX device can be opened by multiple readers,
so conflicts between gpm and the X driver should not happen any more.
No nead to create any additional shared buffers.

Note that I didn't design this event infrastructure. I just started to
work on the synaptics kernel driver when I realized the XFree driver
didn't work with the 2.5.x kernel.

> > > 2) what source of information do you use to program them?
> >
> > The synaptics touchpad interfacing guide. I think this link is still valid:
> >
> > http://www.synaptics.com/decaf/utilities/ACF126.pdf
>
> think so, too. but in fact as my dmesg shows, the touchpad doesn't
> like you..and I would like to use it :)

What does dmesg say?

> So, is /dev/input/mice now the general device to use?
> If yes, is it imps2 or what should we talk to it?

You should now use /dev/input/eventX, for some X. The XFree driver has
code to autodetect the correct X which you can probably reuse for gpm.

        http://w1.894.telia.com/~u89404340/touchpad/index.html

>From the event device, you read data looking like this:

        struct input_event {
                struct timeval time;
                __u16 type;
                __u16 code;
                __s32 value;
        };

The synaptics kernel driver currently reports the following events:

        ABS_X
        ABS_Y
                X, Y coordinates for the finger.

        ABS_PRESSURE
                Z value

        MSC_GESTURE
                W value (emulated if the touchpad doesn't support w)

        BTN_LEFT
        BTN_RIGHT
                Left/right buttons

        BTN_FORWARD
        BTN_BACK
                Up/down buttons, if present.

        BTN_0, ..., BTN_7
                Multi buttons, if present.

Note that the kernel driver only reports changes, so you can no longer
rely on the fact that the touchpad keeps sending data 1s after you
stop using it.

Pass through port devices (pointing sticks for example) get their own
eventX device (at least with the extra kernel patches from the web
page above), but they also report to the /dev/input/mice device, so I
think they will just work without extra gpm support. (I don't have the
hardware to test this though.)

If this data is insufficient for the gpm driver, now would be a good
time to extend/change it, before the stuff gets too widely used. Some
points that have been raised before:

* The W value ought to be split in "number of fingers" and "finger
  width". That would make the protocol general enough to be used for
  other touchpad models too, such as ALPS.

* The Y value is reported in raw form. Should probably be mirrored
  depending on how the touchpad is oriented.

I have also attached a simple test program I created to read from the
event device. Maybe you find it useful for some initial tests.

-- 
Peter Osterlund - petero2@telia.com
http://w1.894.telia.com/~u89404340


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:39 EST