aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorSimon Wood <simon@mungewell.org>2013-10-10 10:20:12 -0400
committerJiri Kosina <jkosina@suse.cz>2013-10-14 14:51:05 -0400
commit7f50547059bd55ac6a98c29fd1989421bdc36ec9 (patch)
tree04ad3e0538b8f5d04b9f90ca32d955e0f1c25a9a /drivers/hid
parentbd04363d3990c0727b7512a79a08c68436878bb0 (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')
-rw-r--r--drivers/hid/hid-lg.c77
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[] = {
1700xC0 /* End Collection */ 1710xC0 /* End Collection */
171}; 172};
172 173
174static __u8 fv_rdesc_fixed[] = {
1750x05, 0x01, /* Usage Page (Desktop), */
1760x09, 0x04, /* Usage (Joystik), */
1770xA1, 0x01, /* Collection (Application), */
1780xA1, 0x02, /* Collection (Logical), */
1790x95, 0x01, /* Report Count (1), */
1800x75, 0x0A, /* Report Size (10), */
1810x15, 0x00, /* Logical Minimum (0), */
1820x26, 0xFF, 0x03, /* Logical Maximum (1023), */
1830x35, 0x00, /* Physical Minimum (0), */
1840x46, 0xFF, 0x03, /* Physical Maximum (1023), */
1850x09, 0x30, /* Usage (X), */
1860x81, 0x02, /* Input (Variable), */
1870x95, 0x0C, /* Report Count (12), */
1880x75, 0x01, /* Report Size (1), */
1890x25, 0x01, /* Logical Maximum (1), */
1900x45, 0x01, /* Physical Maximum (1), */
1910x05, 0x09, /* Usage Page (Button), */
1920x19, 0x01, /* Usage Minimum (01h), */
1930x29, 0x0C, /* Usage Maximum (0Ch), */
1940x81, 0x02, /* Input (Variable), */
1950x95, 0x02, /* Report Count (2), */
1960x06, 0x00, 0xFF, /* Usage Page (FF00h), */
1970x09, 0x01, /* Usage (01h), */
1980x81, 0x02, /* Input (Variable), */
1990x09, 0x02, /* Usage (02h), */
2000x26, 0xFF, 0x00, /* Logical Maximum (255), */
2010x46, 0xFF, 0x00, /* Physical Maximum (255), */
2020x95, 0x01, /* Report Count (1), */
2030x75, 0x08, /* Report Size (8), */
2040x81, 0x02, /* Input (Variable), */
2050x05, 0x01, /* Usage Page (Desktop), */
2060x25, 0x07, /* Logical Maximum (7), */
2070x46, 0x3B, 0x01, /* Physical Maximum (315), */
2080x75, 0x04, /* Report Size (4), */
2090x65, 0x14, /* Unit (Degrees), */
2100x09, 0x39, /* Usage (Hat Switch), */
2110x81, 0x42, /* Input (Variable, Null State), */
2120x75, 0x01, /* Report Size (1), */
2130x95, 0x04, /* Report Count (4), */
2140x65, 0x00, /* Unit, */
2150x06, 0x00, 0xFF, /* Usage Page (FF00h), */
2160x09, 0x01, /* Usage (01h), */
2170x25, 0x01, /* Logical Maximum (1), */
2180x45, 0x01, /* Physical Maximum (1), */
2190x81, 0x02, /* Input (Variable), */
2200x05, 0x01, /* Usage Page (Desktop), */
2210x95, 0x01, /* Report Count (1), */
2220x75, 0x08, /* Report Size (8), */
2230x26, 0xFF, 0x00, /* Logical Maximum (255), */
2240x46, 0xFF, 0x00, /* Physical Maximum (255), */
2250x09, 0x31, /* Usage (Y), */
2260x81, 0x02, /* Input (Variable), */
2270x09, 0x32, /* Usage (Z), */
2280x81, 0x02, /* Input (Variable), */
2290xC0, /* End Collection, */
2300xA1, 0x02, /* Collection (Logical), */
2310x26, 0xFF, 0x00, /* Logical Maximum (255), */
2320x46, 0xFF, 0x00, /* Physical Maximum (255), */
2330x95, 0x07, /* Report Count (7), */
2340x75, 0x08, /* Report Size (8), */
2350x09, 0x03, /* Usage (03h), */
2360x91, 0x02, /* Output (Variable), */
2370xC0, /* End Collection, */
2380xC0 /* End Collection */
239};
240
173static __u8 momo_rdesc_fixed[] = { 241static __u8 momo_rdesc_fixed[] = {
1740x05, 0x01, /* Usage Page (Desktop), */ 2420x05, 0x01, /* Usage Page (Desktop), */
1750x09, 0x04, /* Usage (Joystik), */ 2430x09, 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,