Skip to content

Commit

Permalink
HID: extend mask for BUTTON usage page
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Kosina committed Feb 17, 2010
1 parent ff5cf34 commit 7f978b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
break;

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

switch (field->application) {
case HID_GD_MOUSE:
Expand Down

0 comments on commit 7f978b9

Please sign in to comment.