]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
HID: input: allow mapping of haptic output
authorAngela Czubak <aczubak@google.com>
Mon, 18 Aug 2025 23:08:46 +0000 (23:08 +0000)
committerBenjamin Tissoires <bentiss@kernel.org>
Mon, 15 Sep 2025 12:32:54 +0000 (14:32 +0200)
This change makes it possible to parse output reports by input mapping
functions by HID drivers.

Signed-off-by: Angela Czubak <aczubak@google.com>
Co-developed-by: Jonathan Denose <jdenose@google.com>
Signed-off-by: Jonathan Denose <jdenose@google.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/hid-input.c

index f45f856a127fe7910f1984332f44009d81bd9ff5..f6a920fe3102e7bf71a4f77c6b81ed133fe5b506 100644 (file)
@@ -683,9 +683,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
        if (field->report_count < 1)
                goto ignore;
 
-       /* only LED usages are supported in output fields */
+       /* only LED and HAPTIC usages are supported in output fields */
        if (field->report_type == HID_OUTPUT_REPORT &&
-                       (usage->hid & HID_USAGE_PAGE) != HID_UP_LED) {
+           (usage->hid & HID_USAGE_PAGE) != HID_UP_LED &&
+           (usage->hid & HID_USAGE_PAGE) != HID_UP_HAPTIC) {
                goto ignore;
        }