diff options
author | Peter Osterlund <petero2@telia.com> | 2004-04-12 01:27:55 +0200 |
---|---|---|
committer | Peter Osterlund <petero2@telia.com> | 2006-04-09 04:02:00 +0200 |
commit | 5a3e05478ae3e641791031c241dc00eb43598726 (patch) | |
tree | 9afe8241c4ed96adedb9afd338734e980f5acc00 /synaptics.c | |
parent | bda42daf592497ee210868660ce6be5a0f390e98 (diff) |
Some work on abstracting out the protocol differences from
synaptics.c to make supporting the FreeBSD psm driver possible.
Diffstat (limited to 'synaptics.c')
-rw-r--r-- | synaptics.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/synaptics.c b/synaptics.c index 4bb0301..4acba08 100644 --- a/synaptics.c +++ b/synaptics.c @@ -221,6 +221,16 @@ SetDeviceAndProtocol(LocalDevicePtr local) } } } + switch (priv->proto) { + case SYN_PROTO_PSAUX: + priv->proto_ops = &psaux_proto_operations; + break; + case SYN_PROTO_EVENT: + priv->proto_ops = &event_proto_operations; + break; + default: + break; + } } /* @@ -516,15 +526,7 @@ DeviceOn(DeviceIntPtr dev) return !Success; } - /* Try to grab the event device so that data doesn't leak to /dev/input/mice */ - if (priv->proto == SYN_PROTO_EVENT) { - int ret; - SYSCALL(ret = ioctl(local->fd, EVIOCGRAB, (pointer)1)); - if (ret < 0) { - xf86Msg(X_WARNING, "%s can't grab event device\n", - local->name, errno); - } - } + priv->proto_ops->DeviceOnHook(local); priv->buffer = XisbNew(local->fd, 64); if (!priv->buffer) { @@ -553,8 +555,7 @@ DeviceOff(DeviceIntPtr dev) if (local->fd != -1) { xf86RemoveEnabledDevice(local); - if (priv->proto == SYN_PROTO_PSAUX) - synaptics_set_mode(local->fd, 0); + priv->proto_ops->DeviceOffHook(local); if (priv->buffer) { XisbFree(priv->buffer); priv->buffer = NULL; |