From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88E84C433E6 for ; Thu, 25 Feb 2021 04:44:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 41C2D64ECE for ; Thu, 25 Feb 2021 04:44:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41C2D64ECE Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CFA2B6B0006; Wed, 24 Feb 2021 23:44:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CAC026B006C; Wed, 24 Feb 2021 23:44:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B99296B006E; Wed, 24 Feb 2021 23:44:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0229.hostedemail.com [216.40.44.229]) by kanga.kvack.org (Postfix) with ESMTP id A1EB26B0006 for ; Wed, 24 Feb 2021 23:44:51 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 663AE182C370A for ; Thu, 25 Feb 2021 04:44:51 +0000 (UTC) X-FDA: 77855549982.21.17E06AB Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by imf03.hostedemail.com (Postfix) with ESMTP id E1EC0C0001FE for ; Thu, 25 Feb 2021 04:44:47 +0000 (UTC) Received: by mail-lf1-f53.google.com with SMTP id f1so6635989lfu.3 for ; Wed, 24 Feb 2021 20:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KB5JhlgmS5BmydzLq9Py6A6KtaOeupVMCxOq1ee3I5A=; b=oEgJPsjr3GwDx4EieM3zreXhqsLnn5vLNP9C7yzu9QqPWSnuZOYOqx4EkFaSCmmVpn PSFLqxERn6xBdsKbFbBd3/6gn+dY5wHpga1tMediFaG2wVxW8zMzjeQfohqk79jJmmmV 5bE5xBWSXTXelmjDJMYlabAZVqtwmIWq4rGTm6M6LsRXQf501d3lYYAdFHyqeOeAhCEY dx7KHxjIF+QVDulG+RUcqSKUn6YI3QnLC/Y7xNA2eTfOC8rAxkq1fyxCdPepwkj50tin 9eEjaAjSPwc0DDMaSrg3SHogJODdP1nroIHZ2HEI8T8ReHNnZiwpQkc6hch6etkQokru 93QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KB5JhlgmS5BmydzLq9Py6A6KtaOeupVMCxOq1ee3I5A=; b=Ga7cDOgCWNbDuRDpuiNFKowdUs3bREHZBLsOupyNdfs+l89sTXK2H9lDiOX6/Es2We 5VdXA5PXYMqk36uCKORObuZHawniikP367jymyOWpIxwW1ZC34zcFdPKzLdJBWMgmhuh 0Bx3gLb/I3Ye1FGHz0vhVYs0bhJbudaUNExePvWs2AYv82p+f8+fRDdVxthmjm5jVQJ2 Ul63Fx1FAzxYYSf70vAYJN/4JSFhxO0zehvK5PfgoFrLiwD3TwHpdADWR5gdy8aJrsYM br59A40mbbQdm9kdtWG+rGaQEbjZ2NznphpnMyDEX9Ea9ZjzhB+zf43ntJ1AmCuTsPDM N3Gw== X-Gm-Message-State: AOAM5322kDKnscmPTlMLfkzUCUXKJFhiuf+nA1SX/cxYFA6aMjtbG9eA 99K4/0npnsTVNBYb8a3o3qq7JBxgUeILJbS9cqQdgg== X-Google-Smtp-Source: ABdhPJwiUGaO+d+ipUZgM4gZGa9mAQUnDYLyKbHj9CJRH/M9xve9lAOtTkPa2TIsSPpduor9oqxQpCj+fadwB6R7d6Q= X-Received: by 2002:a19:5609:: with SMTP id k9mr774375lfb.589.1614228289206; Wed, 24 Feb 2021 20:44:49 -0800 (PST) MIME-Version: 1.0 References: <20210225040032.684590-1-lzye@google.com> In-Reply-To: From: Chris Ye Date: Wed, 24 Feb 2021 20:44:37 -0800 Message-ID: Subject: Re: [PATCH] Input: Add "Share" button to Microsoft Xbox One controller. To: Dmitry Torokhov Cc: Chris Ye , linux-mm@kvack.org, linux-kernel@vger.kernel.org, trivial@kernel.org, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E1EC0C0001FE X-Stat-Signature: iuwikmewd7bykdz8fkm6zsa8oewoyhe7 Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf03; identity=mailfrom; envelope-from=""; helo=mail-lf1-f53.google.com; client-ip=209.85.167.53 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614228287-993086 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Dmitry, The latest Xbox One X series has this button, I can add a new XTYPE_XBOXONE_X and only apply the change to the new type. The controller supports bluetooth and the HID usage for this button is consumer 0xB2: 0x05, 0x0C, // Usage Page (Consumer) 0x0A, 0xB2, 0x00, // Usage (Record) Thanks! Chris On Wed, Feb 24, 2021 at 8:33 PM Dmitry Torokhov wrote: > > Hi Chris, > > On Thu, Feb 25, 2021 at 04:00:32AM +0000, Chris Ye wrote: > > Add "Share" button input capability and input event mapping for > > Microsoft Xbox One controller. > > Fixed Microsoft Xbox One controller share button not working under USB > > connection. > > > > Signed-off-by: Chris Ye > > --- > > drivers/input/joystick/xpad.c | 16 ++++++++++++++-- > > 1 file changed, 14 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c > > index 9f0d07dcbf06..08c3e93ccb2f 100644 > > --- a/drivers/input/joystick/xpad.c > > +++ b/drivers/input/joystick/xpad.c > > @@ -368,6 +368,14 @@ static const signed short xpad360_btn[] = { /* buttons for x360 controller */ > > -1 > > }; > > > > +static const signed short xpad_xboxone_btn[] = { > > + /* buttons for xbox one controller */ > > + BTN_TL, BTN_TR, /* Button LB/RB */ > > + BTN_MODE, /* The big X button */ > > + KEY_RECORD, /* The share button */ > > If I understand this correctly, not all Xbox One controllers have this > new key. Is it possible to determine if it is present and only set > capability for controllers that actually have it? > > Also, I am unsure if KEY_RECORD is the best keycode for this. It might, > but does your controller supports bluetooth? What HID usage code does it > send for this key? > > Thanks. > > -- > Dmitry