@@ -43,6 +43,7 @@ struct evdev_client {
struct fasync_struct *fasync;
struct evdev *evdev;
struct list_head node;
+ int slot; /* used to extract MT events via EVIOC */
};
static struct evdev *evdev_table[EVDEV_MINORS];
@@ -624,7 +625,8 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
t = _IOC_NR(cmd) & ABS_MAX;
- abs.value = dev->abs[t];
+ abs.value = input_mt_get_abs_value(dev, t,
+ client->slot);
abs.minimum = dev->absmin[t];
abs.maximum = dev->absmax[t];
abs.fuzz = dev->absfuzz[t];
@@ -665,6 +667,11 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
sizeof(struct input_absinfo))))
return -EFAULT;
+ if (t == ABS_MT_SLOT) {
+ client->slot = abs.value;
+ return 0;
+ }
+
/*
* Take event lock to ensure that we are not
* changing device parameters in the middle