From: "Ahelenia Ziemiańska" <nabijaczleweli@nabijaczleweli.xyz>
To: unlisted-recipients:; (no To-header on input)
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Peter Hutterer <peter.hutterer@who-t.net>,
Jiri Kosina <jikos@kernel.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/4] HID: multitouch: require Finger field to mark Win8 reports as MT
Date: Mon, 8 Mar 2021 18:42:03 +0100 [thread overview]
Message-ID: <019fd182fe7358b14a2f9427572635e518cdb868.1615224800.git.nabijaczleweli@nabijaczleweli.xyz> (raw)
In-Reply-To: <cover.1615224800.git.nabijaczleweli@nabijaczleweli.xyz>
[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]
This effectively changes collection_is_mt from
contact ID in report->field
to
(device is Win8 => collection is finger) && contact ID in report->field
Some devices erroneously report Pen for fingers,
and Win8 stylus-on-touchscreen devices report contact ID,
but mark the accompanying touchscreen device's collection correctly
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
drivers/hid/hid-multitouch.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 8429ebe7097e..8580ace596c2 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -604,9 +604,13 @@ static struct mt_report_data *mt_allocate_report_data(struct mt_device *td,
if (!(HID_MAIN_ITEM_VARIABLE & field->flags))
continue;
- for (n = 0; n < field->report_count; n++) {
- if (field->usage[n].hid == HID_DG_CONTACTID)
- rdata->is_mt_collection = true;
+ if (field->logical == HID_DG_FINGER || td->hdev->group != HID_GROUP_MULTITOUCH_WIN_8) {
+ for (n = 0; n < field->report_count; n++) {
+ if (field->usage[n].hid == HID_DG_CONTACTID) {
+ rdata->is_mt_collection = true;
+ break;
+ }
+ }
}
}
--
2.20.1
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-03-08 17:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-08 17:41 [PATCH v2 0/4] Stylus-on-touchscreen device support наб
2021-03-08 17:42 ` Ahelenia Ziemiańska [this message]
2021-03-08 17:42 ` [PATCH v2 2/4] HID: multitouch: set Stylus suffix for Stylus-application devices, too Ahelenia Ziemiańska
2021-03-08 17:42 ` [PATCH v2 3/4] HID: input: replace outdated HID numbers+comments with macros Ahelenia Ziemiańska
2021-03-08 17:42 ` [PATCH v2 4/4] HID: input: work around Win8 stylus-on-touchscreen reporting Ahelenia Ziemiańska
2021-04-20 13:17 ` [PATCH v2 0/4] Stylus-on-touchscreen device support наб
2021-05-03 9:11 ` Jiri Kosina
2021-05-03 9:39 ` Benjamin Tissoires
2021-05-03 9:52 ` Benjamin Tissoires
2021-05-03 13:00 ` наб
2021-05-04 13:35 ` Benjamin Tissoires
2021-05-05 13:07 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=019fd182fe7358b14a2f9427572635e518cdb868.1615224800.git.nabijaczleweli@nabijaczleweli.xyz \
--to=nabijaczleweli@nabijaczleweli.xyz \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.hutterer@who-t.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).