aboutsummaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2013-04-07 20:52:22 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-04-07 21:02:32 -0700
commita0ef6a348a47bdb3896c468608f9cd19c1c26949 (patch)
treed53c955166783efcfe8a67a5722d68b8f4cf5a40 /drivers/input
parent7a246777a694563c490811f9d398318652a3ffb4 (diff)
Input: MT - handle semi-mt devices in core
Most semi-mt drivers use the slots in a manual way, but really only need to treat the finger count manually. With this patch, a semi-mt driver may use the input-mt core for everything else. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/input-mt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index 71db1930573..d398f1321f1 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -79,6 +79,8 @@ int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots,
}
if (flags & INPUT_MT_DIRECT)
__set_bit(INPUT_PROP_DIRECT, dev->propbit);
+ if (flags & INPUT_MT_SEMI_MT)
+ __set_bit(INPUT_PROP_SEMI_MT, dev->propbit);
if (flags & INPUT_MT_TRACK) {
unsigned int n2 = num_slots * num_slots;
mt->red = kcalloc(n2, sizeof(*mt->red), GFP_KERNEL);
@@ -246,6 +248,7 @@ void input_mt_sync_frame(struct input_dev *dev)
{
struct input_mt *mt = dev->mt;
struct input_mt_slot *s;
+ bool use_count = false;
if (!mt)
return;
@@ -259,7 +262,10 @@ void input_mt_sync_frame(struct input_dev *dev)
}
}
- input_mt_report_pointer_emulation(dev, (mt->flags & INPUT_MT_POINTER));
+ if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT))
+ use_count = true;
+
+ input_mt_report_pointer_emulation(dev, use_count);
mt->frame++;
}