From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752032AbcGYKXn (ORCPT ); Mon, 25 Jul 2016 06:23:43 -0400 Received: from ao2.it ([92.243.12.208]:51220 "EHLO ao2.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928AbcGYKXe (ORCPT ); Mon, 25 Jul 2016 06:23:34 -0400 Date: Mon, 25 Jul 2016 12:23:26 +0200 From: Antonio Ospite To: Mikko Perttunen Cc: jikos@kernel.org, benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Mikko Perttunen Subject: Re: [PATCH v2] HID: sony: disable descriptor fixup for FutureMax Dance Mat Message-Id: <20160725122326.f18e1c7ab4a8d5e0a3a79195@ao2.it> In-Reply-To: <20160721165448.14275-1-mikko.perttunen@kapsi.fi> References: <20160721165448.14275-1-mikko.perttunen@kapsi.fi> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) X-Face: z*RaLf`X<@C75u6Ig9}{oW$H;1_\2t5)({*|jhM/Vb;]yA5\I~93>J<_`<4)A{':UrE Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 21 Jul 2016 19:54:48 +0300 Mikko Perttunen wrote: > From: Mikko Perttunen > > The FutureMax Dance Mat claims to be a SixAxis controller > but breaks if descriptor fixups are applied. Detect the > device using its USB product string and disable fixups > when it is detected. > > Signed-off-by: Mikko Perttunen Acked-by: Antonio Ospite > --- > v2: don't use usb device properties > > drivers/hid/hid-sony.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c > index 310436a..29a1aa9 100644 > --- a/drivers/hid/hid-sony.c > +++ b/drivers/hid/hid-sony.c > @@ -51,6 +51,7 @@ > #define NAVIGATION_CONTROLLER_USB BIT(9) > #define NAVIGATION_CONTROLLER_BT BIT(10) > #define SINO_LITE_CONTROLLER BIT(11) > +#define FUTUREMAX_DANCE_MAT BIT(12) > > #define SIXAXIS_CONTROLLER (SIXAXIS_CONTROLLER_USB | SIXAXIS_CONTROLLER_BT) > #define MOTION_CONTROLLER (MOTION_CONTROLLER_USB | MOTION_CONTROLLER_BT) > @@ -1125,7 +1126,7 @@ static u8 *sony_report_fixup(struct hid_device *hdev, u8 *rdesc, > { > struct sony_sc *sc = hid_get_drvdata(hdev); > > - if (sc->quirks & SINO_LITE_CONTROLLER) > + if (sc->quirks & (SINO_LITE_CONTROLLER | FUTUREMAX_DANCE_MAT)) > return rdesc; > > /* > @@ -2289,6 +2290,9 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) > struct sony_sc *sc; > unsigned int connect_mask = HID_CONNECT_DEFAULT; > > + if (!strcmp(hdev->name, "FutureMax Dance Mat")) > + quirks |= FUTUREMAX_DANCE_MAT; > + > sc = devm_kzalloc(&hdev->dev, sizeof(*sc), GFP_KERNEL); > if (sc == NULL) { > hid_err(hdev, "can't alloc sony descriptor\n"); > -- > 2.9.0 > -- Antonio Ospite http://ao2.it A: Because it messes up the order in which people normally read text. See http://en.wikipedia.org/wiki/Posting_style Q: Why is top-posting such a bad thing?