diff options
author | Simon Wood <simon@mungewell.org> | 2013-10-10 10:20:13 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-10-14 14:51:05 -0400 |
commit | 348cbaa800f8161168b20f85f72abb541c145132 (patch) | |
tree | 5cc7dc0a34eb1ba9979d119ccaf2d7059690697c | |
parent | 7f50547059bd55ac6a98c29fd1989421bdc36ec9 (diff) |
HID: lg: fix Report Descriptor for Logitech MOMO Force (Black)
By default the Logitech MOMO Force (Black) 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>
-rw-r--r-- | drivers/hid/hid-lg.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index 1bfd292cac8f..06eb45fa6331 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #define DFP_RDESC_ORIG_SIZE 97 | 47 | #define DFP_RDESC_ORIG_SIZE 97 |
48 | #define FV_RDESC_ORIG_SIZE 130 | 48 | #define FV_RDESC_ORIG_SIZE 130 |
49 | #define MOMO_RDESC_ORIG_SIZE 87 | 49 | #define MOMO_RDESC_ORIG_SIZE 87 |
50 | #define MOMO2_RDESC_ORIG_SIZE 87 | ||
50 | 51 | ||
51 | /* Fixed report descriptors for Logitech Driving Force (and Pro) | 52 | /* Fixed report descriptors for Logitech Driving Force (and Pro) |
52 | * wheel controllers | 53 | * wheel controllers |
@@ -284,6 +285,54 @@ static __u8 momo_rdesc_fixed[] = { | |||
284 | 0xC0 /* End Collection */ | 285 | 0xC0 /* End Collection */ |
285 | }; | 286 | }; |
286 | 287 | ||
288 | static __u8 momo2_rdesc_fixed[] = { | ||
289 | 0x05, 0x01, /* Usage Page (Desktop), */ | ||
290 | 0x09, 0x04, /* Usage (Joystik), */ | ||
291 | 0xA1, 0x01, /* Collection (Application), */ | ||
292 | 0xA1, 0x02, /* Collection (Logical), */ | ||
293 | 0x95, 0x01, /* Report Count (1), */ | ||
294 | 0x75, 0x0A, /* Report Size (10), */ | ||
295 | 0x15, 0x00, /* Logical Minimum (0), */ | ||
296 | 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */ | ||
297 | 0x35, 0x00, /* Physical Minimum (0), */ | ||
298 | 0x46, 0xFF, 0x03, /* Physical Maximum (1023), */ | ||
299 | 0x09, 0x30, /* Usage (X), */ | ||
300 | 0x81, 0x02, /* Input (Variable), */ | ||
301 | 0x95, 0x0A, /* Report Count (10), */ | ||
302 | 0x75, 0x01, /* Report Size (1), */ | ||
303 | 0x25, 0x01, /* Logical Maximum (1), */ | ||
304 | 0x45, 0x01, /* Physical Maximum (1), */ | ||
305 | 0x05, 0x09, /* Usage Page (Button), */ | ||
306 | 0x19, 0x01, /* Usage Minimum (01h), */ | ||
307 | 0x29, 0x0A, /* Usage Maximum (0Ah), */ | ||
308 | 0x81, 0x02, /* Input (Variable), */ | ||
309 | 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */ | ||
310 | 0x09, 0x00, /* Usage (00h), */ | ||
311 | 0x95, 0x04, /* Report Count (4), */ | ||
312 | 0x81, 0x02, /* Input (Variable), */ | ||
313 | 0x95, 0x01, /* Report Count (1), */ | ||
314 | 0x75, 0x08, /* Report Size (8), */ | ||
315 | 0x26, 0xFF, 0x00, /* Logical Maximum (255), */ | ||
316 | 0x46, 0xFF, 0x00, /* Physical Maximum (255), */ | ||
317 | 0x09, 0x01, /* Usage (01h), */ | ||
318 | 0x81, 0x02, /* Input (Variable), */ | ||
319 | 0x05, 0x01, /* Usage Page (Desktop), */ | ||
320 | 0x09, 0x31, /* Usage (Y), */ | ||
321 | 0x81, 0x02, /* Input (Variable), */ | ||
322 | 0x09, 0x32, /* Usage (Z), */ | ||
323 | 0x81, 0x02, /* Input (Variable), */ | ||
324 | 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */ | ||
325 | 0x09, 0x00, /* Usage (00h), */ | ||
326 | 0x81, 0x02, /* Input (Variable), */ | ||
327 | 0xC0, /* End Collection, */ | ||
328 | 0xA1, 0x02, /* Collection (Logical), */ | ||
329 | 0x09, 0x02, /* Usage (02h), */ | ||
330 | 0x95, 0x07, /* Report Count (7), */ | ||
331 | 0x91, 0x02, /* Output (Variable), */ | ||
332 | 0xC0, /* End Collection, */ | ||
333 | 0xC0 /* End Collection */ | ||
334 | }; | ||
335 | |||
287 | /* | 336 | /* |
288 | * Certain Logitech keyboards send in report #3 keys which are far | 337 | * Certain Logitech keyboards send in report #3 keys which are far |
289 | * above the logical maximum described in descriptor. This extends | 338 | * above the logical maximum described in descriptor. This extends |
@@ -343,6 +392,15 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
343 | } | 392 | } |
344 | break; | 393 | break; |
345 | 394 | ||
395 | case USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2: | ||
396 | if (*rsize == MOMO2_RDESC_ORIG_SIZE) { | ||
397 | hid_info(hdev, | ||
398 | "fixing up Logitech Momo Racing Force (Black) report descriptor\n"); | ||
399 | rdesc = momo2_rdesc_fixed; | ||
400 | *rsize = sizeof(momo2_rdesc_fixed); | ||
401 | } | ||
402 | break; | ||
403 | |||
346 | case USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL: | 404 | case USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL: |
347 | if (*rsize == FV_RDESC_ORIG_SIZE) { | 405 | if (*rsize == FV_RDESC_ORIG_SIZE) { |
348 | hid_info(hdev, | 406 | hid_info(hdev, |