summaryrefslogtreecommitdiff
path: root/include/linux/input
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@gmail.com>2012-11-14 19:59:22 +0400
committerJiri Kosina <jkosina@suse.cz>2012-11-15 13:16:56 +0400
commit29807d1e24b7cd696442d2f600057230f084b3c7 (patch)
tree9fa7122a4c5c7cb6109c092e48a639f57e079b26 /include/linux/input
parentaf8036dd749fbf4e732161ff0f3874759b73be40 (diff)
downloadlinux-29807d1e24b7cd696442d2f600057230f084b3c7.tar.xz
Input: mt: add input_mt_is_used
This patch extracts the test (slot->frame == mt->frame) so that it can be used in third party drivers. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux/input')
-rw-r--r--include/linux/input/mt.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h
index cc5cca774bab..2e86bd0bfba1 100644
--- a/include/linux/input/mt.h
+++ b/include/linux/input/mt.h
@@ -69,6 +69,12 @@ static inline bool input_mt_is_active(const struct input_mt_slot *slot)
return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0;
}
+static inline bool input_mt_is_used(const struct input_mt *mt,
+ const struct input_mt_slot *slot)
+{
+ return slot->frame == mt->frame;
+}
+
int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots,
unsigned int flags);
void input_mt_destroy_slots(struct input_dev *dev);