Skip to content

Commit 7363b25

Browse files
Simon WoodJiri Kosina
authored andcommitted
HID: hid-logitech: Rewrite of descriptor for all DF wheels
Rewrite the HID descriptor for _all_ Driving Force wheels (real or emulated) so that they can report separate Accelerator and Brake axis. If the user wants a combined accel/brake axis, they can use the 'combined pedals' feature. $ echo 1 > /sys/bus/hid/devices/<device-id>/combine_pedals Signed-off-by: Simon Wood <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent b456634 commit 7363b25

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

drivers/hid/hid-lg.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,6 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
343343
unsigned int *rsize)
344344
{
345345
struct lg_drv_data *drv_data = hid_get_drvdata(hdev);
346-
struct usb_device_descriptor *udesc;
347-
__u16 bcdDevice, rev_maj, rev_min;
348346

349347
if ((drv_data->quirks & LG_RDESC) && *rsize >= 91 && rdesc[83] == 0x26 &&
350348
rdesc[84] == 0x8c && rdesc[85] == 0x02) {
@@ -365,18 +363,7 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
365363

366364
/* Several wheels report as this id when operating in emulation mode. */
367365
case USB_DEVICE_ID_LOGITECH_WHEEL:
368-
udesc = &(hid_to_usb_dev(hdev)->descriptor);
369-
if (!udesc) {
370-
hid_err(hdev, "NULL USB device descriptor\n");
371-
break;
372-
}
373-
bcdDevice = le16_to_cpu(udesc->bcdDevice);
374-
rev_maj = bcdDevice >> 8;
375-
rev_min = bcdDevice & 0xff;
376-
377-
/* Update the report descriptor for only the Driving Force wheel */
378-
if (rev_maj == 1 && rev_min == 2 &&
379-
*rsize == DF_RDESC_ORIG_SIZE) {
366+
if (*rsize == DF_RDESC_ORIG_SIZE) {
380367
hid_info(hdev,
381368
"fixing up Logitech Driving Force report descriptor\n");
382369
rdesc = df_rdesc_fixed;

0 commit comments

Comments
 (0)