aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2013-04-07 23:52:22 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-04-08 00:02:32 -0400
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 71db1930573f..d398f1321f14 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,
79 } 79 }
80 if (flags & INPUT_MT_DIRECT) 80 if (flags & INPUT_MT_DIRECT)
81 __set_bit(INPUT_PROP_DIRECT, dev->propbit); 81 __set_bit(INPUT_PROP_DIRECT, dev->propbit);
82 if (flags & INPUT_MT_SEMI_MT)
83 __set_bit(INPUT_PROP_SEMI_MT, dev->propbit);
82 if (flags & INPUT_MT_TRACK) { 84 if (flags & INPUT_MT_TRACK) {
83 unsigned int n2 = num_slots * num_slots; 85 unsigned int n2 = num_slots * num_slots;
84 mt->red = kcalloc(n2, sizeof(*mt->red), GFP_KERNEL); 86 mt->red = kcalloc(n2, sizeof(*mt->red), GFP_KERNEL);
@@ -246,6 +248,7 @@ void input_mt_sync_frame(struct input_dev *dev)
246{ 248{
247 struct input_mt *mt = dev->mt; 249 struct input_mt *mt = dev->mt;
248 struct input_mt_slot *s; 250 struct input_mt_slot *s;
251 bool use_count = false;
249 252
250 if (!mt) 253 if (!mt)
251 return; 254 return;
@@ -259,7 +262,10 @@ void input_mt_sync_frame(struct input_dev *dev)
259 } 262 }
260 } 263 }
261 264
262 input_mt_report_pointer_emulation(dev, (mt->flags & INPUT_MT_POINTER)); 265 if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT))
266 use_count = true;
267
268 input_mt_report_pointer_emulation(dev, use_count);
263 269
264 mt->frame++; 270 mt->frame++;
265} 271}