From 011a7005efebb0a58b46fede63eebddfef8c6ed1 Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Thu, 11 Feb 2010 14:27:49 +0100 Subject: [PATCH 2/2] 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 Signed-off-by: Jiri Kosina --- drivers/hid/hid-input.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index dad7aae..e0bc3e7 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -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: -- 1.6.3.3