Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1480426

[PATCH 4/5] HID:hid-logitech: Rewrite of descriptor for all DF wheels

From Simon Wood <gitsend@mungewell.org>
Newsgroups linux.kernel
Subject [PATCH 4/5] HID:hid-logitech: Rewrite of descriptor for all DF wheels
Date 2016-09-10 01:00 +0200
Message-ID <sfCW6-tE-15@gated-at.bofh.it> (permalink)
References <sfCW5-tE-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <simon@mungewell.org>
---
 drivers/hid/hid-lg.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c
index 06f8a5e..53429c6 100644
--- a/drivers/hid/hid-lg.c
+++ b/drivers/hid/hid-lg.c
@@ -365,18 +365,7 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 
 	/* Several wheels report as this id when operating in emulation mode. */
 	case USB_DEVICE_ID_LOGITECH_WHEEL:
-		udesc = &(hid_to_usb_dev(hdev)->descriptor);
-		if (!udesc) {
-			hid_err(hdev, "NULL USB device descriptor\n");
-			break;
-		}
-		bcdDevice = le16_to_cpu(udesc->bcdDevice);
-		rev_maj = bcdDevice >> 8;
-		rev_min = bcdDevice & 0xff;
-
-		/* Update the report descriptor for only the Driving Force wheel */
-		if (rev_maj == 1 && rev_min == 2 &&
-				*rsize == DF_RDESC_ORIG_SIZE) {
+		if (*rsize == DF_RDESC_ORIG_SIZE) {
 			hid_info(hdev,
 				"fixing up Logitech Driving Force report descriptor\n");
 			rdesc = df_rdesc_fixed;
-- 
2.7.4

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH 4/5] HID:hid-logitech: Rewrite of descriptor for all DF wheels Simon Wood <gitsend@mungewell.org> - 2016-09-10 01:00 +0200
  Re: [PATCH 4/5] HID:hid-logitech: Rewrite of descriptor for all DF  wheels kbuild test robot <lkp@intel.com> - 2016-09-10 03:40 +0200
  Re: [PATCH 4/5] HID:hid-logitech: Rewrite of descriptor for all DF  wheels "Simon Wood" <simon@mungewell.org> - 2016-09-14 21:00 +0200

csiph-web