浏览代码

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>
Jiri Kosina 15 年之前
父节点
当前提交
7f978b9bf5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/hid/hid-input.c

+ 1 - 1
drivers/hid/hid-input.c

@@ -193,7 +193,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		break;
 		break;
 
 
 	case HID_UP_BUTTON:
 	case HID_UP_BUTTON:
-		code = ((usage->hid - 1) & 0xf);
+		code = ((usage->hid - 1) & HID_USAGE);
 
 
 		switch (field->application) {
 		switch (field->application) {
 		case HID_GD_MOUSE:
 		case HID_GD_MOUSE: