diff options
author | Simon Wood <simon@mungewell.org> | 2013-10-10 10:20:12 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-10-14 14:51:05 -0400 |
commit | 7f50547059bd55ac6a98c29fd1989421bdc36ec9 (patch) | |
tree | 04ad3e0538b8f5d04b9f90ca32d955e0f1c25a9a /drivers/hid/hid-lg.c | |
parent | bd04363d3990c0727b7512a79a08c68436878bb0 (diff) |
HID: lg: fix ReportDescriptor for Logitech Formula Vibration
By default the Logitech Formula Vibration presents a combined accel/brake
axis ('Y'). This patch modifies the HID descriptor to present seperate
accel/brake axes ('Y' and 'Z').
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-lg.c')
-rw-r--r-- | drivers/hid/hid-lg.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index c2c7dab7d2c4..1bfd292cac8f 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c | |||
@@ -45,6 +45,7 @@ | |||
45 | /* Size of the original descriptors of the Driving Force (and Pro) wheels */ | 45 | /* Size of the original descriptors of the Driving Force (and Pro) wheels */ |
46 | #define DF_RDESC_ORIG_SIZE 130 | 46 | #define DF_RDESC_ORIG_SIZE 130 |
47 | #define DFP_RDESC_ORIG_SIZE 97 | 47 | #define DFP_RDESC_ORIG_SIZE 97 |
48 | #define FV_RDESC_ORIG_SIZE 130 | ||
48 | #define MOMO_RDESC_ORIG_SIZE 87 | 49 | #define MOMO_RDESC_ORIG_SIZE 87 |
49 | 50 | ||
50 | /* Fixed report descriptors for Logitech Driving Force (and Pro) | 51 | /* Fixed report descriptors for Logitech Driving Force (and Pro) |
@@ -170,6 +171,73 @@ static __u8 dfp_rdesc_fixed[] = { | |||
170 | 0xC0 /* End Collection */ | 171 | 0xC0 /* End Collection */ |
171 | }; | 172 | }; |
172 | 173 | ||
174 | static __u8 fv_rdesc_fixed[] = { | ||
175 | 0x05, 0x01, /* Usage Page (Desktop), */ | ||
176 | 0x09, 0x04, /* Usage (Joystik), */ | ||
177 | 0xA1, 0x01, /* Collection (Application), */ | ||
178 | 0xA1, 0x02, /* Collection (Logical), */ | ||
179 | 0x95, 0x01, /* Report Count (1), */ | ||
180 | 0x75, 0x0A, /* Report Size (10), */ | ||
181 | 0x15, 0x00, /* Logical Minimum (0), */ | ||
182 | 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */ | ||
183 | 0x35, 0x00, /* Physical Minimum (0), */ | ||
184 | 0x46, 0xFF, 0x03, /* Physical Maximum (1023), */ | ||
185 | 0x09, 0x30, /* Usage (X), */ | ||
186 | 0x81, 0x02, /* Input (Variable), */ | ||
187 | 0x95, 0x0C, /* Report Count (12), */ | ||
188 | 0x75, 0x01, /* Report Size (1), */ | ||
189 | 0x25, 0x01, /* Logical Maximum (1), */ | ||
190 | 0x45, 0x01, /* Physical Maximum (1), */ | ||
191 | 0x05, 0x09, /* Usage Page (Button), */ | ||
192 | 0x19, 0x01, /* Usage Minimum (01h), */ | ||
193 | 0x29, 0x0C, /* Usage Maximum (0Ch), */ | ||
194 | 0x81, 0x02, /* Input (Variable), */ | ||
195 | 0x95, 0x02, /* Report Count (2), */ | ||
196 | 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */ | ||
197 | 0x09, 0x01, /* Usage (01h), */ | ||
198 | 0x81, 0x02, /* Input (Variable), */ | ||
199 | 0x09, 0x02, /* Usage (02h), */ | ||
200 | 0x26, 0xFF, 0x00, /* Logical Maximum (255), */ | ||
201 | 0x46, 0xFF, 0x00, /* Physical Maximum (255), */ | ||
202 | 0x95, 0x01, /* Report Count (1), */ | ||
203 | 0x75, 0x08, /* Report Size (8), */ | ||
204 | 0x81, 0x02, /* Input (Variable), */ | ||
205 | 0x05, 0x01, /* Usage Page (Desktop), */ | ||
206 | 0x25, 0x07, /* Logical Maximum (7), */ | ||
207 | 0x46, 0x3B, 0x01, /* Physical Maximum (315), */ | ||
208 | 0x75, 0x04, /* Report Size (4), */ | ||
209 | 0x65, 0x14, /* Unit (Degrees), */ | ||
210 | 0x09, 0x39, /* Usage (Hat Switch), */ | ||
211 | 0x81, 0x42, /* Input (Variable, Null State), */ | ||
212 | 0x75, 0x01, /* Report Size (1), */ | ||
213 | 0x95, 0x04, /* Report Count (4), */ | ||
214 | 0x65, 0x00, /* Unit, */ | ||
215 | 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */ | ||
216 | 0x09, 0x01, /* Usage (01h), */ | ||
217 | 0x25, 0x01, /* Logical Maximum (1), */ | ||
218 | 0x45, 0x01, /* Physical Maximum (1), */ | ||
219 | 0x81, 0x02, /* Input (Variable), */ | ||
220 | 0x05, 0x01, /* Usage Page (Desktop), */ | ||
221 | 0x95, 0x01, /* Report Count (1), */ | ||
222 | 0x75, 0x08, /* Report Size (8), */ | ||
223 | 0x26, 0xFF, 0x00, /* Logical Maximum (255), */ | ||
224 | 0x46, 0xFF, 0x00, /* Physical Maximum (255), */ | ||
225 | 0x09, 0x31, /* Usage (Y), */ | ||
226 | 0x81, 0x02, /* Input (Variable), */ | ||
227 | 0x09, 0x32, /* Usage (Z), */ | ||
228 | 0x81, 0x02, /* Input (Variable), */ | ||
229 | 0xC0, /* End Collection, */ | ||
230 | 0xA1, 0x02, /* Collection (Logical), */ | ||
231 | 0x26, 0xFF, 0x00, /* Logical Maximum (255), */ | ||
232 | 0x46, 0xFF, 0x00, /* Physical Maximum (255), */ | ||
233 | 0x95, 0x07, /* Report Count (7), */ | ||
234 | 0x75, 0x08, /* Report Size (8), */ | ||
235 | 0x09, 0x03, /* Usage (03h), */ | ||
236 | 0x91, 0x02, /* Output (Variable), */ | ||
237 | 0xC0, /* End Collection, */ | ||
238 | 0xC0 /* End Collection */ | ||
239 | }; | ||
240 | |||
173 | static __u8 momo_rdesc_fixed[] = { | 241 | static __u8 momo_rdesc_fixed[] = { |
174 | 0x05, 0x01, /* Usage Page (Desktop), */ | 242 | 0x05, 0x01, /* Usage Page (Desktop), */ |
175 | 0x09, 0x04, /* Usage (Joystik), */ | 243 | 0x09, 0x04, /* Usage (Joystik), */ |
@@ -275,6 +343,15 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
275 | } | 343 | } |
276 | break; | 344 | break; |
277 | 345 | ||
346 | case USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL: | ||
347 | if (*rsize == FV_RDESC_ORIG_SIZE) { | ||
348 | hid_info(hdev, | ||
349 | "fixing up Logitech Formula Vibration report descriptor\n"); | ||
350 | rdesc = fv_rdesc_fixed; | ||
351 | *rsize = sizeof(fv_rdesc_fixed); | ||
352 | } | ||
353 | break; | ||
354 | |||
278 | case USB_DEVICE_ID_LOGITECH_DFP_WHEEL: | 355 | case USB_DEVICE_ID_LOGITECH_DFP_WHEEL: |
279 | if (*rsize == DFP_RDESC_ORIG_SIZE) { | 356 | if (*rsize == DFP_RDESC_ORIG_SIZE) { |
280 | hid_info(hdev, | 357 | hid_info(hdev, |