summaryrefslogtreecommitdiff
path: root/synaptics.c
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2004-04-18 01:18:06 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:02:06 +0200
commitf574d42c776f0687cce5c15406ea870211058b39 (patch)
treea9ac2c5fa547997581b353587a8d01ad6f1d0fcb /synaptics.c
parent7bd534c0e315a2b9bb3f549df0a30f113d21ee93 (diff)
Moved autodev handling to the protocol specific files.
Diffstat (limited to 'synaptics.c')
-rw-r--r--synaptics.c41
1 files changed, 2 insertions, 39 deletions
diff --git a/synaptics.c b/synaptics.c
index 6f01d31..deafc24 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -76,7 +76,6 @@
#define SYNAPTICS_PRIVATE
#include "synaptics.h"
#include "ps2comm.h"
-#include "linux_input.h"
/*****************************************************************************
* Variables without includable headers
@@ -106,10 +105,6 @@ typedef enum {
#define M_PI 3.14159265358979323846
#endif
-/* for auto-dev: */
-#define DEV_INPUT_EVENT "/dev/input"
-#define EVENT_DEV_NAME "event"
-
/*****************************************************************************
* Forward declaration
****************************************************************************/
@@ -183,40 +178,8 @@ SetDeviceAndProtocol(LocalDevicePtr local)
} else if (str_par && !strcmp(str_par, "psaux")) {
/* Already set up */
} else { /* default to auto-dev */
- /* We are trying to find the right eventX device or fall back to
- the psaux protocol and the given device from XF86Config */
- int fd = -1;
- int i;
- for (i = 0; ; i++) {
- char fname[64];
- struct input_id id;
- int ret;
-
- sprintf(fname, "%s/%s%d", DEV_INPUT_EVENT, EVENT_DEV_NAME, i);
- SYSCALL(fd = open(fname, O_RDONLY));
- if (fd < 0) {
- if (errno == ENOENT) {
- ErrorF("%s no synaptics event device found (checked %d nodes)\n",
- local->name, i + 1);
- break;
- } else {
- continue;
- }
- }
- SYSCALL(ret = ioctl(fd, EVIOCGID, &id));
- SYSCALL(close(fd));
- if (ret >= 0) {
- if ((id.bustype == BUS_I8042) &&
- (id.vendor == 0x0002) &&
- (id.product == PSMOUSE_SYNAPTICS)) {
- proto = SYN_PROTO_EVENT;
- xf86Msg(X_PROBED, "%s auto-dev sets Synaptics Device to %s\n",
- local->name, fname);
- xf86ReplaceStrOption(local->options, "Device", fname);
- break;
- }
- }
- }
+ if (event_proto_operations.autoDevProbe(local))
+ proto = SYN_PROTO_EVENT;
}
switch (proto) {
case SYN_PROTO_PSAUX: