Patchwork [2/2] (pre-stable) HID: extend mask for BUTTON usage page

login
register
mail settings
Submitter Stefan Bader
Date Feb. 22, 2010, 2:21 p.m.
Message ID <1266848475-27219-3-git-send-email-stefan.bader@canonical.com>
Download mbox | patch
Permalink /patch/45964/
State Accepted
Delegated to: Andy Whitcroft
Headers show

Comments

Stefan Bader - Feb. 22, 2010, 2:21 p.m.
From: Jiri Kosina <jkosina@suse.cz>

BugLink: http://bugs.launchpad.net/bugs/492056

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>
(cherry-picked from 7f978b9bf535cbbd1ae8d9fbdd7c4f60ab38f260 linux-next)
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
---
 drivers/hid/hid-input.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

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: