Skip to content

Commit a058002

Browse files
AdityaGarg8Jiri Kosina
authored andcommitted
HID: quirks: Add HID_QUIRK_IGNORE_MOUSE quirk
Some USB HID mice have drivers both in HID as well as a separate USB driver. The already existing hid_mouse_ignore_list in hid-quirks manages this, but is not yet configurable by usbhid.quirks, unlike all others like hid_ignore_list. Thus in some HID devices, where the vendor provides USB drivers only for the mouse and lets keyboard handled by the generic hid drivers, presence of such a quirk prevents the user from compiling hid core again to add the device to the table. Signed-off-by: Aditya Garg <gargaditya08@live.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent fe7f7ac commit a058002

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/hid/hid-quirks.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ bool hid_ignore(struct hid_device *hdev)
10611061
}
10621062

10631063
if (hdev->type == HID_TYPE_USBMOUSE &&
1064-
hid_match_id(hdev, hid_mouse_ignore_list))
1064+
hdev->quirks & HID_QUIRK_IGNORE_MOUSE)
10651065
return true;
10661066

10671067
return !!hid_match_id(hdev, hid_ignore_list);
@@ -1265,6 +1265,9 @@ static unsigned long hid_gets_squirk(const struct hid_device *hdev)
12651265
if (hid_match_id(hdev, hid_ignore_list))
12661266
quirks |= HID_QUIRK_IGNORE;
12671267

1268+
if (hid_match_id(hdev, hid_mouse_ignore_list))
1269+
quirks |= HID_QUIRK_IGNORE_MOUSE;
1270+
12681271
if (hid_match_id(hdev, hid_have_special_driver))
12691272
quirks |= HID_QUIRK_HAVE_SPECIAL_DRIVER;
12701273

include/linux/hid.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ struct hid_item {
357357
* | @HID_QUIRK_INPUT_PER_APP:
358358
* | @HID_QUIRK_X_INVERT:
359359
* | @HID_QUIRK_Y_INVERT:
360+
* | @HID_QUIRK_IGNORE_MOUSE:
360361
* | @HID_QUIRK_SKIP_OUTPUT_REPORTS:
361362
* | @HID_QUIRK_SKIP_OUTPUT_REPORT_ID:
362363
* | @HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP:
@@ -382,6 +383,7 @@ struct hid_item {
382383
#define HID_QUIRK_INPUT_PER_APP BIT(11)
383384
#define HID_QUIRK_X_INVERT BIT(12)
384385
#define HID_QUIRK_Y_INVERT BIT(13)
386+
#define HID_QUIRK_IGNORE_MOUSE BIT(14)
385387
#define HID_QUIRK_SKIP_OUTPUT_REPORTS BIT(16)
386388
#define HID_QUIRK_SKIP_OUTPUT_REPORT_ID BIT(17)
387389
#define HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP BIT(18)

0 commit comments

Comments
 (0)