summaryrefslogtreecommitdiff
path: root/eventcomm.c
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2004-05-09 19:23:08 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:02:23 +0200
commite8a16ce65e5207304dda46a852b5628baa06458a (patch)
treef1ff2506ca51609fd2190013e5f4bbac54077cb4 /eventcomm.c
parent744372a41b9e64bafe8ee70748ec7495a89146d3 (diff)
Added support for Synaptics cPad devices. (Also requires a
2.6 kernel patch.) From Jan Steinhoff <Jan.Steinhoff@uni-jena.de>.
Diffstat (limited to 'eventcomm.c')
-rw-r--r--eventcomm.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/eventcomm.c b/eventcomm.c
index bea7499..214565b 100644
--- a/eventcomm.c
+++ b/eventcomm.c
@@ -26,6 +26,17 @@
#define SYSCALL(call) while (((call) == -1) && (errno == EINTR))
+/* list of supported devices */
+static struct device_id_table {
+ unsigned short bustype;
+ unsigned short vendor;
+ unsigned short product;
+} device_id_table[] = {
+ { BUS_I8042, 0x0002, PSMOUSE_SYNAPTICS },
+ { BUS_USB, USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_CPAD },
+ { 0, 0, 0 }
+};
+
/*****************************************************************************
* Function Definitions
@@ -52,14 +63,16 @@ static Bool
event_query_is_synaptics(int fd)
{
struct input_id id;
- int ret;
+ int ret, i;
SYSCALL(ret = ioctl(fd, EVIOCGID, &id));
if (ret >= 0) {
- if ((id.bustype == BUS_I8042) &&
- (id.vendor == 0x0002) &&
- (id.product == PSMOUSE_SYNAPTICS)) {
- return TRUE;
+ for (i = 0; device_id_table[i].bustype; i++) {
+ if ((id.bustype == device_id_table[i].bustype) &&
+ (id.vendor == device_id_table[i].vendor) &&
+ (id.product == device_id_table[i].product)) {
+ return TRUE;
+ }
}
}
return FALSE;