aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Wood <simon@mungewell.org>2013-10-10 10:20:13 -0400
committerJiri Kosina <jkosina@suse.cz>2013-10-14 14:51:05 -0400
commit348cbaa800f8161168b20f85f72abb541c145132 (patch)
tree5cc7dc0a34eb1ba9979d119ccaf2d7059690697c
parent7f50547059bd55ac6a98c29fd1989421bdc36ec9 (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.c58
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[] = {
2840xC0 /* End Collection */ 2850xC0 /* End Collection */
285}; 286};
286 287
288static __u8 momo2_rdesc_fixed[] = {
2890x05, 0x01, /* Usage Page (Desktop), */
2900x09, 0x04, /* Usage (Joystik), */
2910xA1, 0x01, /* Collection (Application), */
2920xA1, 0x02, /* Collection (Logical), */
2930x95, 0x01, /* Report Count (1), */
2940x75, 0x0A, /* Report Size (10), */
2950x15, 0x00, /* Logical Minimum (0), */
2960x26, 0xFF, 0x03, /* Logical Maximum (1023), */
2970x35, 0x00, /* Physical Minimum (0), */
2980x46, 0xFF, 0x03, /* Physical Maximum (1023), */
2990x09, 0x30, /* Usage (X), */
3000x81, 0x02, /* Input (Variable), */
3010x95, 0x0A, /* Report Count (10), */
3020x75, 0x01, /* Report Size (1), */
3030x25, 0x01, /* Logical Maximum (1), */
3040x45, 0x01, /* Physical Maximum (1), */
3050x05, 0x09, /* Usage Page (Button), */
3060x19, 0x01, /* Usage Minimum (01h), */
3070x29, 0x0A, /* Usage Maximum (0Ah), */
3080x81, 0x02, /* Input (Variable), */
3090x06, 0x00, 0xFF, /* Usage Page (FF00h), */
3100x09, 0x00, /* Usage (00h), */
3110x95, 0x04, /* Report Count (4), */
3120x81, 0x02, /* Input (Variable), */
3130x95, 0x01, /* Report Count (1), */
3140x75, 0x08, /* Report Size (8), */
3150x26, 0xFF, 0x00, /* Logical Maximum (255), */
3160x46, 0xFF, 0x00, /* Physical Maximum (255), */
3170x09, 0x01, /* Usage (01h), */
3180x81, 0x02, /* Input (Variable), */
3190x05, 0x01, /* Usage Page (Desktop), */
3200x09, 0x31, /* Usage (Y), */
3210x81, 0x02, /* Input (Variable), */
3220x09, 0x32, /* Usage (Z), */
3230x81, 0x02, /* Input (Variable), */
3240x06, 0x00, 0xFF, /* Usage Page (FF00h), */
3250x09, 0x00, /* Usage (00h), */
3260x81, 0x02, /* Input (Variable), */
3270xC0, /* End Collection, */
3280xA1, 0x02, /* Collection (Logical), */
3290x09, 0x02, /* Usage (02h), */
3300x95, 0x07, /* Report Count (7), */
3310x91, 0x02, /* Output (Variable), */
3320xC0, /* End Collection, */
3330xC0 /* 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,