HID: uclogic: Pass keyboard reports as is
authorNikolai Kondrashov <spbnick@gmail.com>
Thu, 21 Apr 2022 17:50:50 +0000 (19:50 +0200)
committerJiri Kosina <jkosina@suse.cz>
Fri, 6 May 2022 06:34:31 +0000 (08:34 +0200)
Allow keyboard reports from interface #1 of Huion tablets to pass
unmodified, and stop the Wacom X.org driver from handling them.

The method for the latter is rather crude and also take the Dial reports
from the Wacom driver, but it's expected that libinput will be able to
handle them (still to be tested).

This enables Huion HS611 media and desktop keys.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-uclogic-params.c

index 09c332c6a41210fb973fefd31c8dea95ad9b9ff9..b85585ac33722bd4f2eeecf44c5e86e21e66beb8 100644 (file)
@@ -711,8 +711,12 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
        iface = to_usb_interface(hdev->dev.parent);
        bInterfaceNumber = iface->cur_altsetting->desc.bInterfaceNumber;
 
-       /* If it's not a pen interface */
-       if (bInterfaceNumber != 0) {
+       /* If it's a custom keyboard interface */
+       if (bInterfaceNumber == 1) {
+               /* Keep everything intact */
+               goto output;
+       /* Else, if it's not a pen interface */
+       } else if (bInterfaceNumber != 0) {
                uclogic_params_init_invalid(&p);
                goto output;
        }