From 96f3093ba439848ec182481dfc633cb161bcb4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Tue, 3 Aug 2021 23:28:51 -0300 Subject: [PATCH 1/2] Use HID_QUIRK_HIDINPUT_FORCE (fixes #550). We must force HIDINPUT, since after ec5c16d some devices are of class HID_DG_DIGITIZER, which is (incorrectly?) not considered as input by macro IS_INPUT_APPLICATION(). With this quirk all devices are forced to go through hidinput_connect() to be configured as input devices. For instance, XP-PEN G430S was broken by ec5c16d and it works now. --- hid-uclogic-core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hid-uclogic-core.c b/hid-uclogic-core.c index ce30c45..99a5b2d 100644 --- a/hid-uclogic-core.c +++ b/hid-uclogic-core.c @@ -203,6 +203,14 @@ static int uclogic_probe(struct hid_device *hdev, #ifdef HID_QUIRK_NO_EMPTY_INPUT hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT; #endif + /* + * We must force HIDINPUT, since some devices are of class + * HID_DG_DIGITIZER, which is (incorrectly?) not considered as + * input by macro IS_INPUT_APPLICATION(). + * With this quirk all devices are forced to go through + * hidinput_connect() to be configured as input devices. + */ + hdev->quirks |= HID_QUIRK_HIDINPUT_FORCE; /* Allocate and assign driver data */ drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL); From f0927096c45261079201e506ab41e551978d1f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Tue, 3 Aug 2021 23:32:08 -0300 Subject: [PATCH 2/2] Use suffix "Digitizer" for HID_DG_DIGITIZER This is cosmetic, affects the name of the device in dmesg, libinput and xinput. --- hid-uclogic-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hid-uclogic-core.c b/hid-uclogic-core.c index 99a5b2d..ca6f6c4 100644 --- a/hid-uclogic-core.c +++ b/hid-uclogic-core.c @@ -163,6 +163,9 @@ static int uclogic_input_configured(struct hid_device *hdev, case HID_GD_KEYPAD: suffix = "Pad"; break; + case HID_DG_DIGITIZER: + suffix = "Digitizer"; + break; case HID_DG_PEN: suffix = "Pen"; break;