diff options
-rw-r--r-- | COMPATIBILITY | 16 | ||||
-rw-r--r-- | INSTALL | 15 | ||||
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | TODO | 4 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | ps2comm.c | 34 | ||||
-rw-r--r-- | ps2comm.h | 3 | ||||
-rw-r--r-- | synaptics.c | 2 | ||||
-rw-r--r-- | test/test-pad.c | 121 | ||||
-rw-r--r-- | testprotokoll.c | 85 |
10 files changed, 280 insertions, 7 deletions
diff --git a/COMPATIBILITY b/COMPATIBILITY new file mode 100644 index 0000000..476780f --- /dev/null +++ b/COMPATIBILITY @@ -0,0 +1,16 @@ +Acer TravelMate 739TL +Gericom Webboy +Acer TravelMate 210TEV +Compaq Presario 1213EA +Compaq Presario 12XL125 +HP Omnibook XE3 500 +Gericom M6T +Samsung GT8800DXV +Compaq Presario 1800XL584 +Medion MD9580-F +HP Omnibook XE3L (F3446J) +Asus S1300 +Dell Inspiron 2650 + + + @@ -2,7 +2,7 @@ Installation of the Synaptics-Touchpad-Driver for XFree 4.x =========================================================== Author: Stefan Gmeiner <riddlebox@freesurf.ch> -Date: 17.02.02 +Date: 20.04.02 needs: - XFree 4.x - Using with Kernel 2.4.x for x < 10 needs a kernel-patch (see @@ -43,10 +43,17 @@ EndSection Change the Identifier to the same name as in the ServerLayout-section. The Option "Repeater" und "SHMConfig" are at the moment for testing. -6. Start/Restart the X-Server. If the touchpad doesn't work go to -step 7. +6. Add the "CorePointer" option to the InputDevice line at the ServerLayout section: -7. a) Check the XFree-Logfiles +Section "ServerLayout" +... + InputDevice "Mouse[1]" "CorePointer" +... + +7. Start/Restart the X-Server. If the touchpad doesn't work go to +step 8. + +8. a) Check the XFree-Logfiles b) Try to start the XServer with 'startx -- -logverbose 8' for more Output If you can't get the driver working, mail the logfiles and the @@ -14,7 +14,7 @@ XF86COMSRC = $(XF86SRC)/common XF86OSSRC = $(XF86SRC)/os-support -INCLUDES = -I. -I$(XF86COMSRC) -I$(SERVERSRC)/hw/xfree86/loader -I$(XF86OSSRC) -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) +INCLUDES = -I. -I$(XF86COMSRC) -I$(SERVERSRC)/hw/xfree86/loader -I$(XF86OSSRC) -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(TOP)/include -I$(SERVERSRC)/hw/xfree86 -I$(SERVERSRC)/hw/xfree86/parser ALLINCLUDES = $(INCLUDES) $(TOP_INCLUDES) @@ -51,6 +51,9 @@ $(DRIVER)_drv.o: $(OBJS) $(EXTRALIBRARYDEPS) test: $(CC) $(CFLAGS) -o synclient synclient.c +testprotokoll: testprotokoll.c + $(CC) -o testprotokoll testprotokoll.c + clean:: $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut synclient "#"* @@ -5,6 +5,10 @@ * schnelleres scrolling (buttonrelease events) * shared-memory für online konfiguration * ftok benutzen um Shared-Memory ID zu erzeugen +* scrollen geschwindigkeitsabhängig machen +* scrollen (tasten und rand) sollte auch bei gedrückten Tasten funktionieren +* linke Ecken gleiche Funktion wie rechte Ecken bzw. Konfigurierbar + @@ -1 +1 @@ -0.10 +0.11.3 @@ -320,6 +320,40 @@ synaptics_identify(int fd, unsigned long int *ident) return !Success; } +/* + * read mode byte + */ +Bool +synaptics_read_mode(int fd, unsigned char *mode) +{ + byte modes[3]; + +#ifdef DEBUG + ErrorF("Read mode byte...\n"); +#endif + + if((ps2_send_cmd(fd, SYN_QUE_MODES) == Success) && + (ps2_getbyte(fd, &modes[0]) == Success) && + (ps2_getbyte(fd, &modes[1]) == Success) && + (ps2_getbyte(fd, &modes[2]) == Success)) { + + *mode = modes[2]; +#ifdef DEBUG + ErrorF("modes byte %02X%02X%02X\n", modes[0], modes[1], modes[2]); +#endif + if((modes[0] == 0x3B) && (modes[1] == 0x47)) { +#ifdef DEBUG + ErrorF("...done.\n"); +#endif + return Success; + } + } +#ifdef DEBUG + ErrorF("...failed.\n"); +#endif + return !Success; +} + Bool SynapticsEnableDevice(int fd) { @@ -59,6 +59,9 @@ Bool synaptics_set_mode(int fd, byte cmd); Bool +synaptics_read_mode(int fd, unsigned char *mode); + +Bool SynapticsEnableDevice(int fd); Bool diff --git a/synaptics.c b/synaptics.c index b9c9785..501081d 100644 --- a/synaptics.c +++ b/synaptics.c @@ -76,7 +76,7 @@ typedef enum { #define MAX(a, b) (((a)>(b))?(a):(b)) #define DIFF_TIME(a, b) (((a)>(b))?(a)-(b):(b)-(a)) -#define VERSION "0.10p1" +#define VERSION "0.11.3p1" /***************************************************************************** * Forward declaration diff --git a/test/test-pad.c b/test/test-pad.c new file mode 100644 index 0000000..9c6d7ce --- /dev/null +++ b/test/test-pad.c @@ -0,0 +1,121 @@ +#include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <stdio.h> +#include <string.h> +#include <errno.h> + +int getbyte(int fd, unsigned char *b) +{ + return(read(fd, b, 1) == 1); +} + +int putbyte(int fd, unsigned char b) +{ + unsigned char ack; + +printf("write %02X\n", b); + if(write(fd, &b, 1) != 1) + { + fprintf(stderr, "error write: %s\n", strerror(errno)); + return 0; + } + + if(!getbyte(fd, &ack)) + { + fprintf(stderr, "error read: %s\n", strerror(errno)); + return 0; + } +printf("read %02X\n", ack); + + if(ack != 0xFA) + { + fprintf(stderr, "error ack\n"); + return 0; + } + + return 1; +} + +int special_cmd(int fd, unsigned char cmd) +{ + int i; + + if(putbyte(fd, 0xE6)) + for(i=0; i<4; i++) + { +printf("special_cmd %i\n", i); + if((!putbyte(fd, 0xE8)) || (!putbyte(fd, (cmd>>6)&0x3))) + return 0; + cmd<<=2; + } + else + return 0; + return 1; +} + +int send_cmd(int fd, unsigned char cmd) +{ + return(special_cmd(fd, cmd) && putbyte(fd, 0xE9)); +} + +int identify(int fd, unsigned long int *ident) +{ + unsigned char id[3]; + + if(send_cmd(fd, 0x00) && getbyte(fd, &id[0]) && getbyte(fd, &id[1]) && getbyte(fd, &id[2])) + { + *ident = (id[0]<<16)|(id[1]<<8)|id[2]; + printf("ident %06X\n", *ident); + return 1; + } else { + fprintf(stderr, "error identify\n"); + return 0; + } +} + +int reset(int fd) +{ + unsigned char r[2]; + + if(!putbyte(fd, 0xFF)) + { + fprintf(stderr, "error reset\n"); + return 0; + } + + sleep(5); + + if(getbyte(fd, &r[0]) && getbyte(fd, &r[1])) + if(r[0] == 0xAA && r[1] == 0x00) + { + fprintf(stderr, "reset done\n"); + return 1; + } + fprintf(stderr, "error reset ack\n"); + return 0; +} + + + + +int main(int argc, char* argv[]) +{ + int fd; + unsigned long int ident; + + fd = open("/dev/psaux", O_RDWR); + if(fd == -1) + { + fprintf(stderr, "error open: %s\n", strerror(errno)); + exit(0); + } + + reset(fd); + identify(fd, &ident); + + close(fd); + + exit(0); +} diff --git a/testprotokoll.c b/testprotokoll.c new file mode 100644 index 0000000..76d03bd --- /dev/null +++ b/testprotokoll.c @@ -0,0 +1,85 @@ +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <stdio.h> +#include <unistd.h> + +int outputformat = 0; + +void +SynapticsReadPacket(int fd) +{ + int count = 0; + int inSync = 0; + unsigned char pBuf[7], u; + + while(read(fd,&u, 1) == 1) + { + + pBuf[count++] = u; + + /* check first byte */ + if((count == 1) && ((u & 0xC8) != 0x80)) + { + inSync = 0; + count = 0; + printf("Synaptics driver lost sync at 1st byte\n"); + continue; + } + + /* check 4th byte */ + if((count == 4) && ((u & 0xc8) != 0xc0)) + { + inSync = 0; + count = 0; + printf("Synaptics driver lost sync at 4th byte\n"); + continue; + } + + if(count >= 6) + { /* Full packet received */ + if(!inSync) { + inSync = 1; + printf("Synaptics driver resynced.\n"); + } + count = 0; + switch(outputformat) + { + case 1: printf("Paket:%02X-%02X-%02X-%02X-%02X-%02X\n", + pBuf[0], pBuf[1], pBuf[2], pBuf[3], pBuf[4], pBuf[5]); + break; + case 2: printf("x = %i, y = %i, z = %i, w = %i, l = %i, r = %i\n", + ((pBuf[3] & 0x10) << 8) | ((pBuf[1] & 0x0f) << 8) | pBuf[4], + ((pBuf[3] & 0x20) << 7) | ((pBuf[1] & 0xf0) << 4) | pBuf[5], + ((pBuf[0] & 0x30) >> 2) | ((pBuf[0] & 0x04) >> 1) | ((pBuf[3] & 0x04) >> 2), + ((pBuf[0] & 0x30) >> 2) | ((pBuf[0] & 0x04) >> 1) | ((pBuf[3] & 0x04) >> 2), + (pBuf[0] & 0x01) ? 1 : 0, + (pBuf[0] & 0x2) ? 1 : 0); + break; + default: break; + } + } + } +} + +int main(int argc, char* argv[]) +{ + int fd; + + if(argc > 1) + outputformat = atoi(argv[1]); + + + fd=open("/dev/psaux", O_RDONLY); + if(fd==-1) + { + printf("Error opening /dev/psaux\n"); + exit(1); + } + + SynapticsReadPacket(fd); + + close(fd); + + exit(0); +} |