summaryrefslogtreecommitdiff
path: root/drivers/input/input-mt.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2016-07-26 12:07:15 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-07-26 12:07:15 -0700
commit0808882863774ab69066d83f49f511606be024e0 (patch)
treedc5eaab5db6c18e06025356235b0c9ba02bd7a1d /drivers/input/input-mt.c
parente9003c9cfaa17d26991688268b04244adb67ee2b (diff)
parent0097ff3d5dad1f76c5e1099d849d52509500708c (diff)
downloadlinux-next-0808882863774ab69066d83f49f511606be024e0.tar.gz
linux-next-0808882863774ab69066d83f49f511606be024e0.zip
Merge branch 'next' into for-linus
Prepare first round of input updates for 4.8 merge window.
Diffstat (limited to 'drivers/input/input-mt.c')
-rw-r--r--drivers/input/input-mt.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index 54fce56c8023..a1bbec9cda8d 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -218,8 +218,23 @@ void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count)
}
input_event(dev, EV_KEY, BTN_TOUCH, count > 0);
- if (use_count)
+
+ if (use_count) {
+ if (count == 0 &&
+ !test_bit(ABS_MT_DISTANCE, dev->absbit) &&
+ test_bit(ABS_DISTANCE, dev->absbit) &&
+ input_abs_get_val(dev, ABS_DISTANCE) != 0) {
+ /*
+ * Force reporting BTN_TOOL_FINGER for devices that
+ * only report general hover (and not per-contact
+ * distance) when contact is in proximity but not
+ * on the surface.
+ */
+ count = 1;
+ }
+
input_mt_report_finger_count(dev, count);
+ }
if (oldest) {
int x = input_mt_get_value(oldest, ABS_MT_POSITION_X);