提交 1874542d 编写于 作者: F Florian Fainelli 提交者: Jiri Kosina

HID: replace offsets values with their corresponding BTN_* defines

Instead of using magic values, use their corresponding BTN_* defines
from linux/input.h.
Signed-off-by: NFlorian Fainelli <ffainelli@freebox.fr>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 c4ffafa5
......@@ -319,21 +319,21 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
switch (field->application) {
case HID_GD_MOUSE:
case HID_GD_POINTER: code += 0x110; break;
case HID_GD_POINTER: code += BTN_MOUSE; break;
case HID_GD_JOYSTICK:
if (code <= 0xf)
code += BTN_JOYSTICK;
else
code += BTN_TRIGGER_HAPPY;
break;
case HID_GD_GAMEPAD: code += 0x130; break;
case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
default:
switch (field->physical) {
case HID_GD_MOUSE:
case HID_GD_POINTER: code += 0x110; break;
case HID_GD_JOYSTICK: code += 0x120; break;
case HID_GD_GAMEPAD: code += 0x130; break;
default: code += 0x100;
case HID_GD_POINTER: code += BTN_MOUSE; break;
case HID_GD_JOYSTICK: code += BTN_JOYSTICK; break;
case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
default: code += BTN_MISC;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册