aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorSimon Wood <simon@mungewell.org>2013-02-19 22:25:10 -0500
committerJiri Kosina <jkosina@suse.cz>2013-02-20 04:19:10 -0500
commit270baef1fafab50410e0e395ec26834de2dcc390 (patch)
tree134f863ede8b4f34006260896f71d6ac34865725 /drivers/hid
parent5a9b571bacafffaff75f4f523c4479c85e83cb15 (diff)
HID: LG: Add support for Logitech Momo Force (Red) Wheel
This patch provides a modified report descriptor to split accelerator and brake, and adds the 'NO_GET' flag to prevent it hanging on connection. Note: for convience this patch is against the follow patch which was applied earlier this week. https://patchwork.kernel.org/patch/2153471/ 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.c58
1 files changed, 57 insertions, 1 deletions
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c
index 6bb7f059941a..160c48919081 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 MOMO_RDESC_ORIG_SIZE 87
48 49
49/* Fixed report descriptors for Logitech Driving Force (and Pro) 50/* Fixed report descriptors for Logitech Driving Force (and Pro)
50 * wheel controllers 51 * wheel controllers
@@ -169,6 +170,52 @@ static __u8 dfp_rdesc_fixed[] = {
1690xC0 /* End Collection */ 1700xC0 /* End Collection */
170}; 171};
171 172
173static __u8 momo_rdesc_fixed[] = {
1740x05, 0x01, /* Usage Page (Desktop), */
1750x09, 0x04, /* Usage (Joystik), */
1760xA1, 0x01, /* Collection (Application), */
1770xA1, 0x02, /* Collection (Logical), */
1780x95, 0x01, /* Report Count (1), */
1790x75, 0x0A, /* Report Size (10), */
1800x15, 0x00, /* Logical Minimum (0), */
1810x26, 0xFF, 0x03, /* Logical Maximum (1023), */
1820x35, 0x00, /* Physical Minimum (0), */
1830x46, 0xFF, 0x03, /* Physical Maximum (1023), */
1840x09, 0x30, /* Usage (X), */
1850x81, 0x02, /* Input (Variable), */
1860x95, 0x08, /* Report Count (8), */
1870x75, 0x01, /* Report Size (1), */
1880x25, 0x01, /* Logical Maximum (1), */
1890x45, 0x01, /* Physical Maximum (1), */
1900x05, 0x09, /* Usage Page (Button), */
1910x19, 0x01, /* Usage Minimum (01h), */
1920x29, 0x08, /* Usage Maximum (08h), */
1930x81, 0x02, /* Input (Variable), */
1940x06, 0x00, 0xFF, /* Usage Page (FF00h), */
1950x75, 0x0E, /* Report Size (14), */
1960x95, 0x01, /* Report Count (1), */
1970x26, 0xFF, 0x00, /* Logical Maximum (255), */
1980x46, 0xFF, 0x00, /* Physical Maximum (255), */
1990x09, 0x00, /* Usage (00h), */
2000x81, 0x02, /* Input (Variable), */
2010x05, 0x01, /* Usage Page (Desktop), */
2020x75, 0x08, /* Report Size (8), */
2030x09, 0x31, /* Usage (Y), */
2040x81, 0x02, /* Input (Variable), */
2050x09, 0x32, /* Usage (Z), */
2060x81, 0x02, /* Input (Variable), */
2070x06, 0x00, 0xFF, /* Usage Page (FF00h), */
2080x09, 0x01, /* Usage (01h), */
2090x81, 0x02, /* Input (Variable), */
2100xC0, /* End Collection, */
2110xA1, 0x02, /* Collection (Logical), */
2120x09, 0x02, /* Usage (02h), */
2130x95, 0x07, /* Report Count (7), */
2140x91, 0x02, /* Output (Variable), */
2150xC0, /* End Collection, */
2160xC0 /* End Collection */
217};
218
172/* 219/*
173 * Certain Logitech keyboards send in report #3 keys which are far 220 * Certain Logitech keyboards send in report #3 keys which are far
174 * above the logical maximum described in descriptor. This extends 221 * above the logical maximum described in descriptor. This extends
@@ -228,6 +275,15 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
228 } 275 }
229 break; 276 break;
230 277
278 case USB_DEVICE_ID_LOGITECH_MOMO_WHEEL:
279 if (*rsize == MOMO_RDESC_ORIG_SIZE) {
280 hid_info(hdev,
281 "fixing up Logitech Momo Force (Red) report descriptor\n");
282 rdesc = momo_rdesc_fixed;
283 *rsize = sizeof(momo_rdesc_fixed);
284 }
285 break;
286
231 case USB_DEVICE_ID_LOGITECH_DFP_WHEEL: 287 case USB_DEVICE_ID_LOGITECH_DFP_WHEEL:
232 if (*rsize == DFP_RDESC_ORIG_SIZE) { 288 if (*rsize == DFP_RDESC_ORIG_SIZE) {
233 hid_info(hdev, 289 hid_info(hdev,
@@ -558,7 +614,7 @@ static const struct hid_device_id lg_devices[] = {
558 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FORCE3D_PRO), 614 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FORCE3D_PRO),
559 .driver_data = LG_FF }, 615 .driver_data = LG_FF },
560 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL), 616 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL),
561 .driver_data = LG_FF4 }, 617 .driver_data = LG_NOGET | LG_FF4 },
562 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2), 618 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2),
563 .driver_data = LG_FF4 }, 619 .driver_data = LG_FF4 },
564 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL), 620 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL),