linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Wood <gitsend@mungewell.org>
To: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Jiri Kosina <jkosina@suse.cz>,
	Edwin Velds <edwin@velds.nl>,
	Elias Vanderstuyft <elias.vds@gmail.com>,
	Michal Maly <madcatxster@gmail.com>,
	Simon Wood <simon@mungewell.org>
Subject: [Patch-V2 4/6] HID:hid-logitech: Rewrite of descriptor for all DF wheels
Date: Sun, 18 Sep 2016 10:55:40 -0600	[thread overview]
Message-ID: <1474217742-3992-4-git-send-email-simon@mungewell.org> (raw)
In-Reply-To: <1474217742-3992-1-git-send-email-simon@mungewell.org>

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 | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c
index 06f8a5e..ffcf4f1 100644
--- a/drivers/hid/hid-lg.c
+++ b/drivers/hid/hid-lg.c
@@ -343,8 +343,6 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 		unsigned int *rsize)
 {
 	struct lg_drv_data *drv_data = hid_get_drvdata(hdev);
-	struct usb_device_descriptor *udesc;
-	__u16 bcdDevice, rev_maj, rev_min;
 
 	if ((drv_data->quirks & LG_RDESC) && *rsize >= 91 && rdesc[83] == 0x26 &&
 			rdesc[84] == 0x8c && rdesc[85] == 0x02) {
@@ -365,18 +363,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

  parent reply	other threads:[~2016-09-18 16:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09 22:50 [PATCH 1/5] HID:hid-logitech: Introduce dev_attr for combined pedals feature Simon Wood
2016-09-09 22:50 ` [PATCH 2/5] HID:hid-logitech: Add combined pedal support Logitech wheels Simon Wood
2016-09-09 22:50 ` [PATCH 3/5] HID:hid-logitech: Compute combined pedals if not supplied Simon Wood
2016-09-09 22:50 ` [PATCH 4/5] HID:hid-logitech: Rewrite of descriptor for all DF wheels Simon Wood
2016-09-10  1:34   ` kbuild test robot
2016-09-14 18:55   ` Simon Wood
2016-09-09 22:50 ` [PATCH 5/5] HID:hid-logitech: Documentation updates/corrections Simon Wood
2016-09-18 16:55 ` [Patch-V2 1/6] HID:hid-logitech: Introduce control for combined pedals feature Simon Wood
2016-09-18 16:55   ` [Patch-V2 2/6] HID:hid-logitech: Add combined pedal support Logitech wheels Simon Wood
2016-09-18 16:55   ` [Patch-V2 3/6] HID:hid-logitech: Compute combined pedals value Simon Wood
2016-09-18 16:55   ` Simon Wood [this message]
2016-09-18 16:55   ` [Patch-V2 5/6] HID:hid-logitech: Improve Wingman Formula Force GP support Simon Wood
2016-09-18 16:55   ` [Patch-V2 6/6] HID:hid-logitech: Documentation updates/corrections Simon Wood
2016-09-26 13:41   ` [Patch-V2 1/6] HID:hid-logitech: Introduce control for combined pedals feature Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474217742-3992-4-git-send-email-simon@mungewell.org \
    --to=gitsend@mungewell.org \
    --cc=edwin@velds.nl \
    --cc=elias.vds@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madcatxster@gmail.com \
    --cc=simon@mungewell.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).