98ef9c8
From 37e81f1a82ba4f214c05c4cc3807378753c7a867 Mon Sep 17 00:00:00 2001
98ef9c8
From: Allen Hung <allen_hung@dell.com>
98ef9c8
Date: Fri, 20 Nov 2015 18:21:06 +0800
98ef9c8
Subject: [PATCH] HID: multitouch: enable palm rejection if device implements
98ef9c8
 confidence usage
98ef9c8
98ef9c8
The usage Confidence is mandary to Windows Precision Touchpad devices. The
98ef9c8
appearance of this usage is checked in hidinput_connect but the quirk
98ef9c8
MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
98ef9c8
Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
98ef9c8
rejection for the WIN 8 touchpad devices which have implemented usage
98ef9c8
Confidence in its input reports.
98ef9c8
98ef9c8
Tested on Dell XPS 13 laptop.
98ef9c8
98ef9c8
Signed-off-by: Allen Hung <allen_hung@dell.com>
98ef9c8
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
98ef9c8
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
98ef9c8
---
98ef9c8
 drivers/hid/hid-multitouch.c | 5 +++++
98ef9c8
 1 file changed, 5 insertions(+)
98ef9c8
98ef9c8
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
98ef9c8
index 7c811252c1ce..0c94348a168d 100644
98ef9c8
--- a/drivers/hid/hid-multitouch.c
98ef9c8
+++ b/drivers/hid/hid-multitouch.c
98ef9c8
@@ -448,6 +448,11 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
98ef9c8
 			mt_store_field(usage, td, hi);
98ef9c8
 			return 1;
98ef9c8
 		case HID_DG_CONFIDENCE:
98ef9c8
+			if (cls->name == MT_CLS_WIN_8 &&
98ef9c8
+				field->application == HID_DG_TOUCHPAD) {
98ef9c8
+				cls->quirks &= ~MT_QUIRK_ALWAYS_VALID;
98ef9c8
+				cls->quirks |= MT_QUIRK_VALID_IS_CONFIDENCE;
98ef9c8
+			}
98ef9c8
 			mt_store_field(usage, td, hi);
98ef9c8
 			return 1;
98ef9c8
 		case HID_DG_TIPSWITCH:
98ef9c8
-- 
98ef9c8
2.5.0
98ef9c8