diff mbox series

Upd: hid-multitouch: is pen hovering ever possible?

Message ID c484b5f2-d227-6a09-3742-4f9c3c25d779@astralinux.ru
State New
Delegated to: Jiri Kosina
Headers show
Series Upd: hid-multitouch: is pen hovering ever possible? | expand

Commit Message

Dmitry Mastykin Aug. 21, 2020, 11:01 a.m. UTC
Hello guys,

here is a 3-lines patch that made the pen working with hid-multitouch. 
It just delegates pen to hid-input.
Hope it helps someone.

Kind regards,
Dmitry Mastykin


-------- Forwarded Message --------
Subject: hid-multitouch: is pen hovering ever possible?
Date: Fri, 21 Aug 2020 13:24:40 +0300
From: Dmitry Mastykin <dmastykin@astralinux.ru>
To: linux-input@vger.kernel.org

Hello guys,
thanks to all of you for your great work!

Please, answer, is pen hovering ever possible using hid-multitouch driver?
If I remove hid-multitouch - hovering works well with hid-generic.
I can't unbind from hid-multitouch and bind to hid-generic: bind fails 
with "No such device".
I tried to modify hid-multitouch, but was not able to get hovering work 
using multitouch reports.
Then I noticed, that wacom uses non-multitouch reports for their pen 
devices, and added a quirk to hid-multitouch that changes pen's behavior 
to non-multitouch (patch attached). It works, but the way must be wrong(
How should one proceed in right way?

Thank you very much!
Dmitry Mastykin
From ae8672dc7020ed93a7dfbb6d797aea85466f236b Mon Sep 17 00:00:00 2001
From: Dmitry Mastykin <dmastykin@astralinux.ru>
Date: Fri, 21 Aug 2020 13:51:46 +0300
Subject: hid-multitouch: delegate pen to hid-input
diff mbox series

Patch

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 362805ddf377..41d809947a0a 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1334,6 +1334,11 @@  static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		return 1;
 	}
 
+	if (field->application == HID_DG_PEN) {
+		rdata->is_mt_collection = false;
+		return 0;
+	}
+
 	if (rdata->is_mt_collection)
 		return mt_touch_input_mapping(hdev, hi, field, usage, bit, max,
 					      application);