diff options
author | Peter Osterlund <petero2@telia.com> | 2003-05-01 16:41:42 +0200 |
---|---|---|
committer | Peter Osterlund <petero2@telia.com> | 2006-04-09 04:00:52 +0200 |
commit | 3686d0fa73ec40629bf83b1eb1813b92c939aa15 (patch) | |
tree | d0221ad10d831c902d97388a71bcc63af71e666c /ps2comm.c | |
parent | 1f4f3db66d995f9d5f24f5df14001773684f87ec (diff) |
Merged some stuff from version 0.11.3.
Diffstat (limited to 'ps2comm.c')
-rw-r--r-- | ps2comm.c | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -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) { |