From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755793AbcIIWvd (ORCPT ); Fri, 9 Sep 2016 18:51:33 -0400 Received: from host18.canaca.com ([66.49.204.205]:49210 "EHLO host18.canaca.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755722AbcIIWv3 (ORCPT ); Fri, 9 Sep 2016 18:51:29 -0400 From: Simon Wood To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jiri Kosina , Edwin Velds , Elias Vanderstuyft , Michal Maly , Simon Wood Subject: [PATCH 4/5] HID:hid-logitech: Rewrite of descriptor for all DF wheels Date: Fri, 9 Sep 2016 16:50:48 -0600 Message-Id: <1473461449-8060-4-git-send-email-simon@mungewell.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473461449-8060-1-git-send-email-simon@mungewell.org> References: <1473461449-8060-1-git-send-email-simon@mungewell.org> X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host18.canaca.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mungewell.org X-Get-Message-Sender-Via: host18.canaca.com: authenticated_id: gitsend@mungewell.org X-Authenticated-Sender: host18.canaca.com: gitsend@mungewell.org X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: rewritten was: [simon@mungewell.org], actual sender does not match Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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//combine_pedals Signed-off-by: Simon Wood --- 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