From b3c8ba44cc6d91e4b73286440909b51b160d1a83 Mon Sep 17 00:00:00 2001 From: Jake Day Date: Fri, 1 Sep 2017 14:31:53 -0400 Subject: [PATCH] fix for multitouch and allow auto detection of touchscreen in udev --- kernel/drivers/hid/hid-multitouch.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/drivers/hid/hid-multitouch.c b/kernel/drivers/hid/hid-multitouch.c index 09f1cd608..3edf56856 100644 --- a/kernel/drivers/hid/hid-multitouch.c +++ b/kernel/drivers/hid/hid-multitouch.c @@ -131,6 +131,7 @@ struct mt_device { static void mt_post_parse_default_settings(struct mt_device *td); static void mt_post_parse(struct mt_device *td); +static int contact_count_seen; /* classes of device behavior */ #define MT_CLS_DEFAULT 0x0001 @@ -559,9 +560,10 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi, usage->usage_index >= field->report_count) return 1; - if (td->cc_index < 0) { + if (contact_count_seen != 1) { td->cc_index = field->index; td->cc_value_index = usage->usage_index; + contact_count_seen++; } return 1; @@ -1047,10 +1049,6 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi) suffix = "Pen"; /* force BTN_STYLUS to allow tablet matching in udev */ __set_bit(BTN_STYLUS, hi->input->keybit); - } else if (hi->report->field[0]->logical == HID_DG_TOUCHSCREEN) { - suffix = "SingleTouch"; - /* force BTN_STYLUS to allow tablet matching in udev */ - __set_bit(BTN_STYLUS, hi->input->keybit); } else { switch (field->application) { case HID_GD_KEYBOARD: