diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-01-04 06:20:56 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-01-04 06:20:56 -0500 |
commit | cf2f765f1896064e34c6f0f2ef896ff058dd5c06 (patch) | |
tree | 5bb51af0bfcd5f72a740dee0c8b97ae358643d05 /drivers/hid/hid-input.c | |
parent | 92688c0c3c1c9e2daf705d307e8fda1b5a180d26 (diff) |
HID: handle joysticks with large number of buttons
Current HID code doesn't properly handle HID joysticks which have
larger number of buttons than what fits into current range reserved
for BTN_JOYSTICK.
One such joystick reported to not work properly is Saitek X52 Pro
Flight System.
We can't extend the range to fit more buttons in, because of backwards
compatibility reasons.
Therefore this patch introduces a new BTN_TRIGGER_HAPPY range, and
uses these to map the buttons which are over BTN_JOYSTICK limit.
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> [for the input.h part]
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r-- | drivers/hid/hid-input.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 5862b0f3b55d..dad7aae9c975 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -198,7 +198,12 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
198 | switch (field->application) { | 198 | switch (field->application) { |
199 | case HID_GD_MOUSE: | 199 | case HID_GD_MOUSE: |
200 | case HID_GD_POINTER: code += 0x110; break; | 200 | case HID_GD_POINTER: code += 0x110; break; |
201 | case HID_GD_JOYSTICK: code += 0x120; break; | 201 | case HID_GD_JOYSTICK: |
202 | if (code <= 0xf) | ||
203 | code += BTN_JOYSTICK; | ||
204 | else | ||
205 | code += BTN_TRIGGER_HAPPY; | ||
206 | break; | ||
202 | case HID_GD_GAMEPAD: code += 0x130; break; | 207 | case HID_GD_GAMEPAD: code += 0x130; break; |
203 | default: | 208 | default: |
204 | switch (field->physical) { | 209 | switch (field->physical) { |