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: Florian Fainelli <ffainelli@freebox.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
c4ffafa51b
commit
1874542d95
1 changed files with 6 additions and 6 deletions
|
@ -319,21 +319,21 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
||||||
|
|
||||||
switch (field->application) {
|
switch (field->application) {
|
||||||
case HID_GD_MOUSE:
|
case HID_GD_MOUSE:
|
||||||
case HID_GD_POINTER: code += 0x110; break;
|
case HID_GD_POINTER: code += BTN_MOUSE; break;
|
||||||
case HID_GD_JOYSTICK:
|
case HID_GD_JOYSTICK:
|
||||||
if (code <= 0xf)
|
if (code <= 0xf)
|
||||||
code += BTN_JOYSTICK;
|
code += BTN_JOYSTICK;
|
||||||
else
|
else
|
||||||
code += BTN_TRIGGER_HAPPY;
|
code += BTN_TRIGGER_HAPPY;
|
||||||
break;
|
break;
|
||||||
case HID_GD_GAMEPAD: code += 0x130; break;
|
case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
|
||||||
default:
|
default:
|
||||||
switch (field->physical) {
|
switch (field->physical) {
|
||||||
case HID_GD_MOUSE:
|
case HID_GD_MOUSE:
|
||||||
case HID_GD_POINTER: code += 0x110; break;
|
case HID_GD_POINTER: code += BTN_MOUSE; break;
|
||||||
case HID_GD_JOYSTICK: code += 0x120; break;
|
case HID_GD_JOYSTICK: code += BTN_JOYSTICK; break;
|
||||||
case HID_GD_GAMEPAD: code += 0x130; break;
|
case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
|
||||||
default: code += 0x100;
|
default: code += BTN_MISC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue