diff options
author | Simon Wood <simon@mungewell.org> | 2013-02-19 22:25:10 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-02-20 04:19:10 -0500 |
commit | 270baef1fafab50410e0e395ec26834de2dcc390 (patch) | |
tree | 134f863ede8b4f34006260896f71d6ac34865725 /drivers/hid | |
parent | 5a9b571bacafffaff75f4f523c4479c85e83cb15 (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.c | 58 |
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[] = { | |||
169 | 0xC0 /* End Collection */ | 170 | 0xC0 /* End Collection */ |
170 | }; | 171 | }; |
171 | 172 | ||
173 | static __u8 momo_rdesc_fixed[] = { | ||
174 | 0x05, 0x01, /* Usage Page (Desktop), */ | ||
175 | 0x09, 0x04, /* Usage (Joystik), */ | ||
176 | 0xA1, 0x01, /* Collection (Application), */ | ||
177 | 0xA1, 0x02, /* Collection (Logical), */ | ||
178 | 0x95, 0x01, /* Report Count (1), */ | ||
179 | 0x75, 0x0A, /* Report Size (10), */ | ||
180 | 0x15, 0x00, /* Logical Minimum (0), */ | ||
181 | 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */ | ||
182 | 0x35, 0x00, /* Physical Minimum (0), */ | ||
183 | 0x46, 0xFF, 0x03, /* Physical Maximum (1023), */ | ||
184 | 0x09, 0x30, /* Usage (X), */ | ||
185 | 0x81, 0x02, /* Input (Variable), */ | ||
186 | 0x95, 0x08, /* Report Count (8), */ | ||
187 | 0x75, 0x01, /* Report Size (1), */ | ||
188 | 0x25, 0x01, /* Logical Maximum (1), */ | ||
189 | 0x45, 0x01, /* Physical Maximum (1), */ | ||
190 | 0x05, 0x09, /* Usage Page (Button), */ | ||
191 | 0x19, 0x01, /* Usage Minimum (01h), */ | ||
192 | 0x29, 0x08, /* Usage Maximum (08h), */ | ||
193 | 0x81, 0x02, /* Input (Variable), */ | ||
194 | 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */ | ||
195 | 0x75, 0x0E, /* Report Size (14), */ | ||
196 | 0x95, 0x01, /* Report Count (1), */ | ||
197 | 0x26, 0xFF, 0x00, /* Logical Maximum (255), */ | ||
198 | 0x46, 0xFF, 0x00, /* Physical Maximum (255), */ | ||
199 | 0x09, 0x00, /* Usage (00h), */ | ||
200 | 0x81, 0x02, /* Input (Variable), */ | ||
201 | 0x05, 0x01, /* Usage Page (Desktop), */ | ||
202 | 0x75, 0x08, /* Report Size (8), */ | ||
203 | 0x09, 0x31, /* Usage (Y), */ | ||
204 | 0x81, 0x02, /* Input (Variable), */ | ||
205 | 0x09, 0x32, /* Usage (Z), */ | ||
206 | 0x81, 0x02, /* Input (Variable), */ | ||
207 | 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */ | ||
208 | 0x09, 0x01, /* Usage (01h), */ | ||
209 | 0x81, 0x02, /* Input (Variable), */ | ||
210 | 0xC0, /* End Collection, */ | ||
211 | 0xA1, 0x02, /* Collection (Logical), */ | ||
212 | 0x09, 0x02, /* Usage (02h), */ | ||
213 | 0x95, 0x07, /* Report Count (7), */ | ||
214 | 0x91, 0x02, /* Output (Variable), */ | ||
215 | 0xC0, /* End Collection, */ | ||
216 | 0xC0 /* 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), |