Skip to content

Commit 7f978b9

Browse files
author
Jiri Kosina
committed
HID: extend mask for BUTTON usage page
Now that joystick button usages can expand over 15 buttons, we have to properly mask out the code from hid usage to cover the whole 0xffff available space. Reported-by: Stefan Bader <stefan.bader@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent ff5cf34 commit 7f978b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/hid/hid-input.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
193193
break;
194194

195195
case HID_UP_BUTTON:
196-
code = ((usage->hid - 1) & 0xf);
196+
code = ((usage->hid - 1) & HID_USAGE);
197197

198198
switch (field->application) {
199199
case HID_GD_MOUSE:

0 commit comments

Comments
 (0)