diff mbox

[2/2] input: evdev: Add EVIOC mechanism to extract the MT slot state

Message ID 1274788379-11026-3-git-send-email-rydberg@euromail.se (mailing list archive)
State New, archived
Headers show

Commit Message

Henrik Rydberg May 25, 2010, 11:52 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 2ee6c7a..8b68b88 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -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