From patchwork Fri Nov 6 20:35:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Praznik X-Patchwork-Id: 7572801 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DC9339F1C4 for ; Fri, 6 Nov 2015 20:36:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0DC39206AA for ; Fri, 6 Nov 2015 20:36:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 29D45206AB for ; Fri, 6 Nov 2015 20:36:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161826AbbKFUg2 (ORCPT ); Fri, 6 Nov 2015 15:36:28 -0500 Received: from mail-ig0-f171.google.com ([209.85.213.171]:38170 "EHLO mail-ig0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161863AbbKFUgO (ORCPT ); Fri, 6 Nov 2015 15:36:14 -0500 Received: by igbxm8 with SMTP id xm8so19016121igb.1 for ; Fri, 06 Nov 2015 12:36:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=7V9ly+k2ELlzjGxY+YbngGEzZB31LGCmpfS1FICrl0A=; b=ygdx0GD5LVtmZ7/12IuQhsb2vIq0O97akRVc02JRYoorGgLg/iKb01qPDLuSrHlsH/ eB1v1CpOczfZU9yvizBtdCHEUp8jZodFYPYVdEP/JsvRWcQai9PhSGxcxD02DRpe9J1b x0OPSPd3td1vwdy32t5VKAm1kj7B/WMEeKlOn/K5Ce8G2kI95EmwMXxSMNf0W0prStjO RcSbBg3IMUNzfw0d6PIIuac6xRZkNojUdfnKROw5q1ZDaCqsRAKr/s7IFmqCIkUUX7zr qW3y0O0iwCoEwmYPuQIb+l7seVIbVqsFaBKCOrv+8AZOeE2cMcK+kp7C7dQIkm/VclcK GGKg== X-Received: by 10.50.60.6 with SMTP id d6mr11868228igr.54.1446842174244; Fri, 06 Nov 2015 12:36:14 -0800 (PST) Received: from localhost.localdomain.localdomain (cpe-104-231-99-148.neo.res.rr.com. [104.231.99.148]) by smtp.gmail.com with ESMTPSA id xg6sm271527igb.6.2015.11.06.12.36.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Nov 2015 12:36:13 -0800 (PST) From: Frank Praznik To: linux-input@vger.kernel.org Cc: jkosina@suse.cz, Frank Praznik Subject: [PATCH] hid: sony: Remove the size check for the Dualshock 4 HID Descriptor Date: Fri, 6 Nov 2015 15:35:53 -0500 Message-Id: <1446842153-4231-1-git-send-email-frank.praznik@gmail.com> X-Mailer: git-send-email 2.4.3 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sony has modified the HID descriptor in new revisions of the Dualshock 4 which causes the size check in the descriptor replacement function to fail. Remove it so that new revisions of the controller will work correctly. The module is completely replacing the descriptor instead of patching it, so the size check isn't really necessary anyways. Signed-off-by: Frank Praznik --- This fixes the following bug: https://bugzilla.kernel.org/show_bug.cgi?id=107081 drivers/hid/hid-sony.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 661f94f..e38d287 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -1137,11 +1137,11 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc, * the gyroscope values to corresponding axes so we need a * modified one. */ - if ((sc->quirks & DUALSHOCK4_CONTROLLER_USB) && *rsize == 467) { + if (sc->quirks & DUALSHOCK4_CONTROLLER_USB) { hid_info(hdev, "Using modified Dualshock 4 report descriptor with gyroscope axes\n"); rdesc = dualshock4_usb_rdesc; *rsize = sizeof(dualshock4_usb_rdesc); - } else if ((sc->quirks & DUALSHOCK4_CONTROLLER_BT) && *rsize == 357) { + } else if (sc->quirks & DUALSHOCK4_CONTROLLER_BT) { hid_info(hdev, "Using modified Dualshock 4 Bluetooth report descriptor\n"); rdesc = dualshock4_bt_rdesc; *rsize = sizeof(dualshock4_bt_rdesc);