[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1274788379-11026-3-git-send-email-rydberg@euromail.se>
Date: Tue, 25 May 2010 13:52:59 +0200
From: "Henrik Rydberg" <rydberg@...omail.se>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
Mika Kuoppala <mika.kuoppala@...ia.com>,
Peter Hutterer <peter.hutterer@...-t.net>,
Benjamin Tissoires <tissoire@...a.fr>,
Stephane Chatty <chatty@...c.fr>,
Rafi Rubin <rafi@...s.upenn.edu>,
Michael Poole <mdpoole@...ilus.org>,
Henrik Rydberg <rydberg@...omail.se>
Subject: [PATCH 2/2] input: evdev: Add EVIOC mechanism to extract the MT slot state
This patch adds the ability to extract the MT slot state sequentially
via EVIOCGABS. The slot parameter is first selected by calling
EVIOCSABS with ABS_MT_SLOT as argument, followed by a set of EVIOCGABS
calls. The slot selection is local to the evdev client handler, and
does not affect the actual input state.
Signed-off-by: Henrik Rydberg <rydberg@...omail.se>
---
drivers/input/evdev.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
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
--
1.6.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists