diff options
author | Vojtech Pavlik <vojtech@suse.cz> | 2005-09-05 01:07:59 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-09-05 01:07:59 -0400 |
commit | 0aebfdac042b63d0f2625414062e138a4333181c (patch) | |
tree | 44d08bf2575e2dc16d304891cc90711bfd2fdf94 /drivers/usb | |
parent | b8c9c642db4ab0811cc5bb0d8b90cc7819055c95 (diff) |
Input: add HID simulation mappings
Add simulation usage page mappings to hid-input.c to support
a new crop of joysticks using them to designate Rudder and
Throttle controls.
Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/input/hid-debug.h | 17 | ||||
-rw-r--r-- | drivers/usb/input/hid-input.c | 9 | ||||
-rw-r--r-- | drivers/usb/input/hid.h | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/drivers/usb/input/hid-debug.h b/drivers/usb/input/hid-debug.h index 52437e5e2e78..789df807b113 100644 --- a/drivers/usb/input/hid-debug.h +++ b/drivers/usb/input/hid-debug.h | |||
@@ -85,6 +85,23 @@ static const struct hid_usage_entry hid_usage_table[] = { | |||
85 | {0, 0x91, "D-PadDown"}, | 85 | {0, 0x91, "D-PadDown"}, |
86 | {0, 0x92, "D-PadRight"}, | 86 | {0, 0x92, "D-PadRight"}, |
87 | {0, 0x93, "D-PadLeft"}, | 87 | {0, 0x93, "D-PadLeft"}, |
88 | { 2, 0, "Simulation" }, | ||
89 | {0, 0xb0, "Aileron"}, | ||
90 | {0, 0xb1, "AileronTrim"}, | ||
91 | {0, 0xb2, "Anti-Torque"}, | ||
92 | {0, 0xb3, "Autopilot"}, | ||
93 | {0, 0xb4, "Chaff"}, | ||
94 | {0, 0xb5, "Collective"}, | ||
95 | {0, 0xb6, "DiveBrake"}, | ||
96 | {0, 0xb7, "ElectronicCountermeasures"}, | ||
97 | {0, 0xb8, "Elevator"}, | ||
98 | {0, 0xb9, "ElevatorTrim"}, | ||
99 | {0, 0xba, "Rudder"}, | ||
100 | {0, 0xbb, "Throttle"}, | ||
101 | {0, 0xbc, "FlightCommunications"}, | ||
102 | {0, 0xbd, "FlareRelease"}, | ||
103 | {0, 0xbe, "LandingGear"}, | ||
104 | {0, 0xbf, "ToeBrake"}, | ||
88 | { 7, 0, "Keyboard" }, | 105 | { 7, 0, "Keyboard" }, |
89 | { 8, 0, "LED" }, | 106 | { 8, 0, "LED" }, |
90 | {0, 0x01, "NumLock"}, | 107 | {0, 0x01, "NumLock"}, |
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c index 3b162a19d7b5..fa4f79d88aa7 100644 --- a/drivers/usb/input/hid-input.c +++ b/drivers/usb/input/hid-input.c | |||
@@ -131,6 +131,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
131 | map_key(code); | 131 | map_key(code); |
132 | break; | 132 | break; |
133 | 133 | ||
134 | |||
135 | case HID_UP_SIMULATION: | ||
136 | |||
137 | switch (usage->hid & 0xffff) { | ||
138 | case 0xba: map_abs(ABS_RUDDER); break; | ||
139 | case 0xbb: map_abs(ABS_THROTTLE); break; | ||
140 | } | ||
141 | break; | ||
142 | |||
134 | case HID_UP_GENDESK: | 143 | case HID_UP_GENDESK: |
135 | 144 | ||
136 | if ((usage->hid & 0xf0) == 0x80) { /* SystemControl */ | 145 | if ((usage->hid & 0xf0) == 0x80) { /* SystemControl */ |
diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h index f3b85a0c200c..cea5cf34b5f9 100644 --- a/drivers/usb/input/hid.h +++ b/drivers/usb/input/hid.h | |||
@@ -173,6 +173,7 @@ struct hid_item { | |||
173 | 173 | ||
174 | #define HID_UP_UNDEFINED 0x00000000 | 174 | #define HID_UP_UNDEFINED 0x00000000 |
175 | #define HID_UP_GENDESK 0x00010000 | 175 | #define HID_UP_GENDESK 0x00010000 |
176 | #define HID_UP_SIMULATION 0x00020000 | ||
176 | #define HID_UP_KEYBOARD 0x00070000 | 177 | #define HID_UP_KEYBOARD 0x00070000 |
177 | #define HID_UP_LED 0x00080000 | 178 | #define HID_UP_LED 0x00080000 |
178 | #define HID_UP_BUTTON 0x00090000 | 179 | #define HID_UP_BUTTON 0x00090000 |