Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp370281pxu; Wed, 25 Nov 2020 05:27:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8KquwozDopUxk3+H+4rMOZsj82MmFmAjOeNAsNbkEvnPCCP4pZFb26GbyUxP4+UWaOJRL X-Received: by 2002:a17:906:14d:: with SMTP id 13mr3185830ejh.516.1606310863766; Wed, 25 Nov 2020 05:27:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606310863; cv=none; d=google.com; s=arc-20160816; b=t590+G+kgy4tjGeXp0LYRx2iLcK70GeBcDOhNIXWcDosDBtjsR+J+FvKQmy0IdeGZ+ iaiDLMyWM3VLfzUTeI5GJZF1+NL/66ReVBPiiU/CKNvCM6ftXkXBInNYbk4ZwXVJmvmg JcQLoLFYCh8yN0tKzKivCcKx30mg2eNFVhWpQmb7ZNZUvTY2N9CJxrvWni7sFG5jsjk5 AfQkS3xANhQDuxy6mhb8RiISiK3uM7+3ml/tmbrl/SBfs+S+OFZH4q+YnmSmWBA2rNUp UWx25ZKO+gXKBPnoFgQ53doW03+6cTJK1awLsnbCRYtga4YIogHfu687AZDu5I5cxXuT 3eDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=pnKXvPLkiku8VX1Jl1Z5WUqDBQMdnz/YCsSvWsJUYiA=; b=NF9BJqDgpXPwaFnNZqdd5AVoTSUm64tNr3IUbrT9jhsmdDFW8HECTte5CrkCbx140Z 2BK2ARqzbdCyFmKfLR1OA159a8fz3KO5hUaGrLqzKKUaRHrFMedcrH3yWakKXbIjr6+C UOcl1jBqHm91Kvf0fifbUe47Xt9qwyoiIai/c+lExxFIVRRtz2VKCw7Hlm16lY3KqMeL 8A2bMSwURwJy1F5fCw1B3+JImwrJeIYVjynyU/vke1k5y15GT8s7sbY5Tk+RKcAw34uz Il6zIhXEpU59MEGnGgPKG6Fq2c05KqLJQ6xD7G6j+ZIB44fQG/dfzo1FKkrbcYdrhpiv QlDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JaNPK9Id; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si973625ejc.296.2020.11.25.05.27.21; Wed, 25 Nov 2020 05:27:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JaNPK9Id; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729519AbgKYNYo (ORCPT + 99 others); Wed, 25 Nov 2020 08:24:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:54548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726284AbgKYNYo (ORCPT ); Wed, 25 Nov 2020 08:24:44 -0500 Received: from pobox.suse.cz (nat1.prg.suse.com [195.250.132.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D3F92206F9; Wed, 25 Nov 2020 13:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606310684; bh=Uth3l3AAtRqxAfUEmaMbHH6l2nSJ+VikVia8DQVLVo4=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=JaNPK9Ide9xjpJqJGJVL/G5GTSBa7DwVB7apw5nh0wLkoWfpvrgY6Xc3FDumD9BwL J+CXklLmylOG97yPp2sNGR9NS7u/bqPBtH2rCwBBE1tUElghYgyDn+wm8UVLLvL6ot VKALR+Nf2fq9vcOEqjpR4LgjFEGPWnF/zDjSBa+Y= Date: Wed, 25 Nov 2020 14:24:40 +0100 (CET) From: Jiri Kosina To: Pascal Giard cc: Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Sanjay Govind Subject: Re: [PATCH v2] HID: sony: support for ghlive ps3/wii u dongles In-Reply-To: <20201108013818.12214-1-pascal.giard@etsmtl.ca> Message-ID: References: <20201009022722.123943-1-pascal.giard@etsmtl.ca> <20201108013818.12214-1-pascal.giard@etsmtl.ca> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 7 Nov 2020, Pascal Giard wrote: > This commit adds support for the Guitar Hero Live PS3 and Wii U dongles. > > These dongles require a "magic" USB control message [1] to be sent > approximately every 10 seconds otherwise the dongle will not report > events where the strumbar is hit while a fret is being held. > > Also, inspired by a patch sent on linux-input by Sanjay Govind [2], the > accelerometer is mapped to ABS_RY for tilt. > > Interestingly, the Wii U and PS3 dongles share the same VID and PID. > > [1] https://github.com/ghlre/GHLtarUtility/ > [2] https://marc.info/?l=linux-input&m=157242835928542&w=2 > > Signed-off-by: Pascal Giard > --- > differences from v1: > * Patches hid-sony instead of creating a new driver > * Changed memory allocation scheme in case of fail > --- > drivers/hid/Kconfig | 1 + > drivers/hid/hid-ids.h | 3 ++ > drivers/hid/hid-sony.c | 115 +++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 119 insertions(+) > > diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig > index 34f07371716d..e2df2ae112a5 100644 > --- a/drivers/hid/Kconfig > +++ b/drivers/hid/Kconfig > @@ -897,6 +897,7 @@ config HID_SONY > * Buzz controllers > * Sony PS3 Blue-ray Disk Remote Control (Bluetooth) > * Logitech Harmony adapter for Sony Playstation 3 (Bluetooth) > + * Guitar Hero Live PS3 and Wii U guitar dongles > > config SONY_FF > bool "Sony PS2/3/4 accessories force feedback support" > diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h > index 1c71a1aa76b2..e3a3942079cf 100644 > --- a/drivers/hid/hid-ids.h > +++ b/drivers/hid/hid-ids.h > @@ -1060,6 +1060,9 @@ > #define USB_DEVICE_ID_SONY_BUZZ_CONTROLLER 0x0002 > #define USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER 0x1000 > > +#define USB_VENDOR_ID_SONY_GHLIVE 0x12ba > +#define USB_DEVICE_ID_SONY_PS3WIIU_GHLIVE_DONGLE 0x074b > + > #define USB_VENDOR_ID_SINO_LITE 0x1345 > #define USB_DEVICE_ID_SINO_LITE_CONTROLLER 0x3008 > > diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c > index 4c6ed6ef31f1..700bea6239f6 100644 > --- a/drivers/hid/hid-sony.c > +++ b/drivers/hid/hid-sony.c > @@ -11,6 +11,7 @@ > * Copyright (c) 2013 Colin Leitner > * Copyright (c) 2014-2016 Frank Praznik > * Copyright (c) 2018 Todd Kelner > + * Copyright (c) 2020 Pascal Giard > */ > > /* > @@ -35,6 +36,8 @@ > #include > #include > #include > +#include > +#include > #include > > #include "hid-ids.h" > @@ -56,6 +59,8 @@ > #define NSG_MR5U_REMOTE_BT BIT(14) > #define NSG_MR7U_REMOTE_BT BIT(15) > #define SHANWAN_GAMEPAD BIT(16) > +#define GHL_GUITAR_PS3WIIU BIT(17) > +#define GHL_GUITAR_CONTROLLER BIT(18) Hi Pascal, thanks for fixing the previous version. This one looks good to me, I just have one remaining question -- why do we need both quirks here? Given the particular VID/PID gets both of them set anyway (and only that VID/PID), and the code is shared, what is the point of consuming the extra bit? Thanks, -- Jiri Kosina SUSE Labs