diff mbox

[1/1] HID: multitouch: enable palm rejection if device implements confidence usage

Message ID 1447839706-3192-1-git-send-email-allen_hung@dell.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Allen Hung Nov. 18, 2015, 9:41 a.m. UTC
The usage Confidence is mandary to Windows Precision Touchpad devices. The
appearance of this usage is checked in hidinput_connect but the quirk
MT_QUIRK_VALID_IS_CONFIDENCE is not applied to the device accordingly.
Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable the
palm rejection for the devices which implement the usage confidence in its
input reports.

Tested on Dell XPS 13 laptop.

Signed-off-by: Allen Hung <allen_hung@dell.com>
---
 drivers/hid/hid-multitouch.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Benjamin Tissoires Nov. 18, 2015, 10:10 a.m. UTC | #1
On Wed, Nov 18, 2015 at 10:41 AM, Allen Hung <allen_hung@dell.com> wrote:
> The usage Confidence is mandary to Windows Precision Touchpad devices. The
> appearance of this usage is checked in hidinput_connect but the quirk
> MT_QUIRK_VALID_IS_CONFIDENCE is not applied to the device accordingly.
> Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable the
> palm rejection for the devices which implement the usage confidence in its
> input reports.
>
> Tested on Dell XPS 13 laptop.
>
> Signed-off-by: Allen Hung <allen_hung@dell.com>
> ---
>  drivers/hid/hid-multitouch.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 426b2f1..661de1d 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -448,6 +448,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
>                         mt_store_field(usage, td, hi);
>                         return 1;
>                 case HID_DG_CONFIDENCE:
> +                       cls->quirks &= ~MT_QUIRK_ALWAYS_VALID;
> +                       cls->quirks |= MT_QUIRK_VALID_IS_CONFIDENCE;

NACK: you are going to break a *lot* of multitouch panels with this change.

Please target the modification to only touchpads that are following
the Precision Touchpad spec. Even there, I will need to be sure that
there will be no side effect, but we will have a much thiner spectre
than blindly enabling this.

For the record, Windows 7 touchscreens used to put any meaning in the
confidence tag.

Cheers,
Benjamin

>                         mt_store_field(usage, td, hi);
>                         return 1;
>                 case HID_DG_TIPSWITCH:
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 426b2f1..661de1d 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -448,6 +448,8 @@  static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 			mt_store_field(usage, td, hi);
 			return 1;
 		case HID_DG_CONFIDENCE:
+			cls->quirks &= ~MT_QUIRK_ALWAYS_VALID;
+			cls->quirks |= MT_QUIRK_VALID_IS_CONFIDENCE;
 			mt_store_field(usage, td, hi);
 			return 1;
 		case HID_DG_TIPSWITCH: