psmouse: synaptics (2.6.0-test1|2)
Hello!
My touchpad stops working with 2.5.74.
With 2.6.0test2 I got minimal success:
If I attach an external ps2mouse while booting, I can use this one. Until I remove it, soon the kernel (psmouse I think) tries to init the touchpad which fails.
My questions:
1) why are you implementing drivers in the kernel?
2) what source of information do you use to program them?
3) how can I read /dev/misc/psaux in Linux 2.6 ? 3.1) howto get gpm running?
3.2) is the patch mentioned for X implemented in X cvs?
Nico
Signature · 2 lines
echo God bless America | sed 's/.*\(A.*$\)/Why \1?/' pgp: new id: 0x8D0E27A4 | ftp.schottelius.org/pub/familiy/nico/pgp-key.new
Quoted 2 lines · Nico Schottelius
My questions:
3) how can I read/dev/misc/psauxin Linux 2.6 ?
AFAIK, you can't.
Quoted 1 line
1) why are you implementing drivers in the kernel?
Because the raw psaux device is no longer exposed to user space.
Quoted 1 line
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
Quoted 1 line
3.1) howto get gpm running?
You have to hack gpm to add support for the 2.6 kernel driver. Until someone fixes gpm you have to use the "psmouse_noext=1" module option.
Quoted 1 line
3.2) is the patch mentioned for X implemented in X cvs?
No, not currently. Aside from technical considerations, there is also a license problem, because the synaptics driver is GPL:ed, which is not compatible (I think) with the license used by XFree86. This means that all copyright holders for the synaptics driver need to agree to change the license, or their contributions have to be removed and reimplemented.
Signature · 2 lines
Peter Osterlund - [email protected] http://w1.894.telia.com/~u89404340
Peter Osterlund [Mon, Jul 28, 2003 at 09:13:49PM +0200]:
Quoted 5 lines
Quoted 2 lines · Nico Schottelius
My questions:
3) how can I read/dev/misc/psauxin Linux 2.6 ?AFAIK, you can't.
that could be a problem..
Quoted 3 lines
Quoted 1 line
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)
Quoted 5 lines
Quoted 1 line
2) what source of information do you use to program them?
The synaptics touchpad interfacing guide. I think this link is still valid:
think so, too. but in fact as my dmesg shows, the touchpad doesn't like you..and I would like to use it :)
So, is /dev/input/mice now the general device to use? If yes, is it imps2 or what should we talk to it?
Quoted 3 lines
Quoted 1 line
3.1) howto get gpm running?
You have to hack gpm to add support for the 2.6 kernel driver.
...another brick in the .. another hack in gpm.
Quoted 2 lines
Until
someone fixes gpm you have to use the "psmouse_noext=1" module option.
good hint, at least somehow I can work with X & gpm..
Quoted 6 lines
Quoted 2 lines
3.2) is the patch mentioned for X implemented in X cvs?
No, not currently. Aside from technical considerations, there is also a license problem, because the synaptics driver is GPL:ed, which is not compatible (I think) with the license used by XFree86.
Btw, aren't there any 'real' alternatives to xfree86?
Quoted 4 lines
This means
that all copyright holders for the synaptics driver need to agree to change the license, or their contributions have to be removed and reimplemented.
...or xfree86 people have to change to gpl...
good evenin'
Nico
Signature · 2 lines
echo God bless America | sed 's/.*\(A.*$\)/Why \1?/' pgp: new id: 0x8D0E27A4 | ftp.schottelius.org/pub/familiy/nico/pgp-key.new
Quoted 11 lines · Nico Schottelius
Peter Osterlund [Mon, Jul 28, 2003 at 09:13:49PM +0200]:
Quoted 5 lines
Quoted 2 lines · Nico Schottelius
My questions:
3) how can I read/dev/misc/psauxin Linux 2.6 ?AFAIK, you can't.
that could be a problem..
Quoted 2 lines
Quoted 1 line
1) why are you implementing drivers in the kernel?
Quoted 7 lines
Quoted 1 line
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.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
2) what source of information do you use to program them?
The synaptics touchpad interfacing guide. I think this link is still valid:
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?
Quoted 2 lines
So, is
/dev/input/micenow 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
Quoted 1 line
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.
Signature · 2 lines
Peter Osterlund - [email protected] http://w1.894.telia.com/~u89404340
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#define EVDEV "/dev/input/event0"
// From linux/include/linux/input.h
struct input_event {
struct timeval time;
unsigned short type;
unsigned short code;
unsigned int value;
};static inline double doubleTime(const timeval& tv)
{
return tv.tv_sec + tv.tv_usec / 1000000.0;
}static const char* typeStr(int evType)
{
static char buf[16];
switch (evType) {
case 0x00: return "RST";
case 0x01: return "KEY";
case 0x02: return "REL";
case 0x03: return "ABS";
case 0x04: return "MSC";
case 0x11: return "LED";
case 0x12: return "SND";
case 0x14: return "REP";
case 0x15: return "FF ";
default:
sprintf(buf, "%02x ", evType);
return buf;
}
}static const char* keyStr(int key)
{
static char buf[16];
switch (key) {
case 0x110: return "BTN_LEFT ";
case 0x111: return "BTN_RIGHT ";
case 0x112: return "BTN_MIDDLE ";
case 0x113: return "BTN_SIDE ";
case 0x114: return "BTN_EXTRA ";
case 0x115: return "BTN_FORWARD";
case 0x116: return "BTN_BACK ";
default:
sprintf(buf, "%4x", key);
return buf;
}
}static const char* relStr(int code)
{
static char buf[16];
switch (code) {
case 0x00: return "X ";
case 0x01: return "Y ";
case 0x02: return "Z ";
case 0x06: return "HWHEEL";
case 0x07: return "DIAL ";
case 0x08: return "WHEEL ";
case 0x09: return "MISC ";
default:
sprintf(buf, "%4x", code);
return buf;
}
}static const char* absStr(int code)
{
static char buf[16];
switch (code) {
case 0x00: return "ABS_X ";
case 0x01: return "ABS_Y ";
case 0x18: return "ABS_PRESSURE";
case 0x28: return "ABS_MISC ";
default:
sprintf(buf, "%4x", code);
return buf;
}
}static const char* codeStr(int evType, int code)
{
static char buf[16];
switch (evType) {
case 0x01: // KEY
return keyStr(code);
case 0x02: // REL
return relStr(code);
case 0x03:
return absStr(code); // ABS
default:
sprintf(buf, "%4x", code);
return buf;
}
}int main(int argc, char* argv[])
{
const char* devName = EVDEV;
if (argc > 1)
devName = argv[1];
FILE* f = fopen(devName, "r");
if (!f) {
fprintf(stderr, "Can't open file %s, errno:%d (%s)\n",
devName, errno, strerror(errno));
exit(1);
}
input_event ev;
double t0 = 0;
while (fread(&ev, sizeof(input_event), 1, f) == 1) {
if (t0 == 0)
t0 = doubleTime(ev.time);
double t = doubleTime(ev.time) - t0;
printf("%10f %s %s %4d\n", t, typeStr(ev.type), codeStr(ev.type, ev.code),
ev.value);
}
fclose(f);
return 0;
}