HID: multitouch: add quirks for Lenovo Yoga Book 9i
PATCH 1/1 HID: multitouch: add quirks for Lenovo Yoga Book 9i
Add required quirks for Lenovo Yoga Book 9i Gen 8 to Gen 10 models, including a new quirk providing for custom input device naming and dropping erroneous InRange reports.
The Lenovo Yoga Book 9i is a dual-screen laptop, with a single composite USB device providing both touch and tablet interfaces for both screens. All inputs report through a single device, differentiated solely by report numbers. As there is no way for udev to differentiate the inputs based on USB vendor/product ID or interface numbers, custom naming is required to match against for downstream configuration. A firmware bug also results in an erroneous InRange message report (with everything other than X/Y as 0) being received after the stylus leaves proximity, blocking later touch events.
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-multitouch.c | 73 ++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -833,6 +833,7 @@#define USB_DEVICE_ID_LENOVO_X1_TAB3 0x60b5#define USB_DEVICE_ID_LENOVO_X12_TAB 0x60fe#define USB_DEVICE_ID_LENOVO_X12_TAB2 0x61ae +#define USB_DEVICE_ID_LENOVO_YOGABOOK9I 0x6161#define USB_DEVICE_ID_LENOVO_OPTICAL_USB_MOUSE_600E 0x600e#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D 0x608d#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019 0x6019
drivers/hid/hid-multitouch.c +73 -0
115 lines not on this page · raw message
Signature · 1 line
2.49.0
Jiri Kosina
maintainerQuoted 79 lines · Brian Howard
Add required quirks for Lenovo Yoga Book 9i Gen 8 to Gen 10 models, including a new quirk providing for custom input device naming and dropping erroneous InRange reports.
The Lenovo Yoga Book 9i is a dual-screen laptop, with a single composite USB device providing both touch and tablet interfaces for both screens. All inputs report through a single device, differentiated solely by report numbers. As there is no way for udev to differentiate the inputs based on USB vendor/product ID or interface numbers, custom naming is required to match against for downstream configuration. A firmware bug also results in an erroneous InRange message report (with everything other than X/Y as 0) being received after the stylus leaves proximity, blocking later touch events.
Signed-off-by Brian Howard <[email protected]>Tested-by Brian Howard <[email protected]>Reported-by Andrei Shumailov <[email protected]>--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-multitouch.c | 73 ++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+)drivers/hid/hid-ids.h +1
-0@@ -833,6 +833,7 @@#define USB_DEVICE_ID_LENOVO_X1_TAB3 0x60b5#define USB_DEVICE_ID_LENOVO_X12_TAB 0x60fe#define USB_DEVICE_ID_LENOVO_X12_TAB2 0x61ae +#define USB_DEVICE_ID_LENOVO_YOGABOOK9I 0x6161#define USB_DEVICE_ID_LENOVO_OPTICAL_USB_MOUSE_600E 0x600e#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D 0x608d#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019 0x6019drivers/hid/hid-multitouch.c +11
-0@@ -76,6 +76,7 @@ MODULE_LICENSE("GPL");#define MT_QUIRK_DISABLE_WAKEUP BIT(21)#define MT_QUIRK_ORIENTATION_INVERT BIT(22)#define MT_QUIRK_APPLE_TOUCHBAR BIT(23) +#define MT_QUIRK_YOGABOOK9I BIT(24)#define MT_INPUTMODE_TOUCHSCREEN 0x02#define MT_INPUTMODE_TOUCHPAD 0x03@@ -229,6 +230,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);#define MT_CLS_RAZER_BLADE_STEALTH 0x0112#define MT_CLS_SMART_TECH 0x0113#define MT_CLS_APPLE_TOUCHBAR 0x0114 +#define MT_CLS_YOGABOOK9I 0x0115#define MT_CLS_SIS 0x0457#define MT_DEFAULT_MAXCONTACT 10@@ -424,6 +426,14 @@ static const struct mt_class mt_classes[] = { .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP | MT_QUIRK_ALWAYS_VALID | MT_QUIRK_CONTACT_CNT_ACCURATE, + }, + { .name = MT_CLS_YOGABOOK9I, + .quirks = MT_QUIRK_ALWAYS_VALID | + MT_QUIRK_FORCE_MULTI_INPUT | + MT_QUIRK_SEPARATE_APP_REPORT | + MT_QUIRK_HOVERING | + MT_QUIRK_YOGABOOK9I, + .export_all_inputs = true }, { } };@@ -1557,6 +1567,7 @@ static void mt_report(struct hid_device *hid, struct hid_report *report)struct mt_device *td =hid_get_drvdata (hid);struct hid_field *field = report->field[0 ];struct mt_report_data *rdata; +int f, i;if (!(hid->claimed &HID_CLAIMED_INPUT ))return ;
drivers/hid/hid-multitouch.c static void mt_report(struct hid_device *hid, struct hid_report *report) · line 1583
Quoted 8 lines
drivers/hid/hid-multitouch.c +5
-0@@ -1565,6 +1576,38 @@ static void mt_report(struct hid_device *hid, struct hid_report *report)if (rdata && rdata->is_mt_collection)return mt_touch_report (hid, rdata); +/* Lenovo Yoga Book 9i requires consuming and dropping certain bogus reports */ +if (rdata && rdata->application && + (rdata->application->quirks &MT_QUIRK_YOGABOOK9I )) { + +bool all_zero_report = true;
Minor nit: why do you declare this variable in this scope, but the f and i iterators in the global function scope?
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
PATCH v2 1/1 HID: multitouch: add quirks for Lenovo Yoga Book 9i
The Lenovo Yoga Book 9i is a dual-screen laptop, with a single composite USB device providing both touch and tablet interfaces for both screens. All inputs report through a single device, differentiated solely by report numbers. As there is no way for udev to differentiate the inputs based on USB vendor/product ID or interface numbers, custom naming is required to match against for downstream configuration. A firmware bug also results in an erroneous InRange message report being received after the stylus leaves proximity, blocking later touch events. Add required quirks for Gen 8 to Gen 10 models, including a new quirk providing for custom input device naming and dropping erroneous InRange reports.
---
V1->V2 Changes:
- Changed definition of f and i varliables to the loop scope.
drivers/hid/hid-ids.h | 1 + drivers/hid/hid-multitouch.c | 72 ++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -833,6 +833,7 @@#define USB_DEVICE_ID_LENOVO_X1_TAB3 0x60b5#define USB_DEVICE_ID_LENOVO_X12_TAB 0x60fe#define USB_DEVICE_ID_LENOVO_X12_TAB2 0x61ae +#define USB_DEVICE_ID_LENOVO_YOGABOOK9I 0x6161#define USB_DEVICE_ID_LENOVO_OPTICAL_USB_MOUSE_600E 0x600e#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D 0x608d#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019 0x6019
drivers/hid/hid-multitouch.c +72 -0
108 lines not on this page · raw message
Signature · 1 line
2.49.0
Quoted 14 lines · Brian Howard
Add required quirks for Lenovo Yoga Book 9i Gen 8 to Gen 10 models, including a new quirk providing for custom input device naming and dropping erroneous InRange reports.
The Lenovo Yoga Book 9i is a dual-screen laptop, with a single composite USB device providing both touch and tablet interfaces for both screens. All inputs report through a single device, differentiated solely by report numbers. As there is no way for udev to differentiate the inputs based on USB vendor/product ID or interface numbers, custom naming is required to match against for downstream configuration. A firmware bug also results in an erroneous InRange message report (with everything other than X/Y as 0) being received after the stylus leaves proximity, blocking later touch events.
Quoted 4 lines
Signed-off-by Brian Howard <[email protected]>Tested-by Brian Howard <[email protected]>Reported-by Andrei Shumailov <[email protected]>
Applied, thanks.
Signature · 2 lines
Jiri Kosina SUSE Labs
Jiri Kosina
maintainerQuoted 14 lines · Jiri Kosina
Quoted 14 lines
Add required quirks for Lenovo Yoga Book 9i Gen 8 to Gen 10 models, including a new quirk providing for custom input device naming and dropping erroneous InRange reports.
The Lenovo Yoga Book 9i is a dual-screen laptop, with a single composite USB device providing both touch and tablet interfaces for both screens. All inputs report through a single device, differentiated solely by report numbers. As there is no way for udev to differentiate the inputs based on USB vendor/product ID or interface numbers, custom naming is required to match against for downstream configuration. A firmware bug also results in an erroneous InRange message report (with everything other than X/Y as 0) being received after the stylus leaves proximity, blocking later touch events.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Brian Howard <[email protected]>Tested-by Brian Howard <[email protected]>Reported-by Andrei Shumailov <[email protected]>Applied, thanks.
v2 was actually applied, just the response was improperly threaded, sorry.
Signature · 2 lines
Jiri Kosina SUSE Labs