Skip to content

Commit e98e380

Browse files
jwrdegoedebentiss
authored andcommitted
HID: asus: Add event handler to catch unmapped Asus Vendor UsagePage codes
Various Asus devices generate HID events using the Asus Vendor specific UsagePage 0xff31 and hid-asus will map these in its input_mapping for all devices to which it binds (independent of any quirks). Add an event callback which check for unmapped (because sofar unknown) usages within the Asus Vendor UsagePage and log a warning for these. The purpose of this patch is to help debugging / find such unmapped codes and add them to the asus_input_mapping() function. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
1 parent e195ca6 commit e98e380

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/hid/hid-asus.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,18 @@ static int asus_report_input(struct asus_drvdata *drvdat, u8 *data, int size)
241241
return 1;
242242
}
243243

244+
static int asus_event(struct hid_device *hdev, struct hid_field *field,
245+
struct hid_usage *usage, __s32 value)
246+
{
247+
if ((usage->hid & HID_USAGE_PAGE) == 0xff310000 &&
248+
(usage->hid & HID_USAGE) != 0x00 && !usage->type) {
249+
hid_warn(hdev, "Unmapped Asus vendor usagepage code 0x%02x\n",
250+
usage->hid & HID_USAGE);
251+
}
252+
253+
return 0;
254+
}
255+
244256
static int asus_raw_event(struct hid_device *hdev,
245257
struct hid_report *report, u8 *data, int size)
246258
{
@@ -832,6 +844,7 @@ static struct hid_driver asus_driver = {
832844
#ifdef CONFIG_PM
833845
.reset_resume = asus_reset_resume,
834846
#endif
847+
.event = asus_event,
835848
.raw_event = asus_raw_event
836849
};
837850
module_hid_driver(asus_driver);

0 commit comments

Comments
 (0)