Message ID | CAAL3-=88exVfuL1Y-kvPNbsU+d-UTfDLFViWVObFLtbC4xueeA@mail.gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp523vqn; Thu, 16 Nov 2023 09:46:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRs9Z050nFUM3q8XXO8s9OUwQM+buqzEH6+TIqCSzT/B7qzdMkdtgIBZIpvrIW4TckcVZ1 X-Received: by 2002:a05:6a20:258f:b0:187:e3a5:b35d with SMTP id k15-20020a056a20258f00b00187e3a5b35dmr1634120pzd.13.1700156803658; Thu, 16 Nov 2023 09:46:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700156803; cv=none; d=google.com; s=arc-20160816; b=yw4grjCVpuwzXXFJWI+THyJBwhGqgItLDPcyrjy8s03RmTj9attO5Ru1odJzURnPW0 ptD0cd0Tfo8cv+k2WmPGDSvgMKz9CjWFguap7y4atICkpBX2HzT95hjcTtaQBqB63vPm bY3rwAitP93RKbm6mWFlVuHy1lxNi33f1b/sm37eP0K7tIMn+rT9+f0SIECHkqe6ypDx h0i+2belFxw3UEd+MZt5+YybpuZk5V0XW7E/wRxu5ukzBCCL4Y85/bxQrSLREfcuHjE7 KQx+EC+jhSsTybuimxKfqOUtVD5ilgGhHH9OGpG4YLtFLLUZL0UsJ39wPgrYPwv1yHOU ZOgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=31lYSY2gScfJmzy6bBEtYXDpksRo7piXakrkacNysY0=; fh=I58+3tNMN+skl5KFOKjUPp+JiMAABj97zNzsaJzEh5Q=; b=Y+WuJr5HflUYNtbm9Vv72T+S711lJgHqSX6G9F8dLQvemdKLHAzpYGAzy3dkPJ8pKc DX3ob3ZXvjR6wvraC2bgb/SLhgXoFhy/xMfpBmwpak8nxRu681tMxGDZsgHNMzZPScaI I9hd4pqLu6N9KYtUKwIRdffkc++OXTn5UNaxhGDbZIF+egcWSmywlm4FyTkhbuG63MrW iLRPtBKvIHTmCXq4d5edW84flrb98YakuB2u6LdJddCbSdqIeoCRbcW9X2b/7kDcBs0u E/NWV+tiHMUZkR7yZsBZ6niFqYD7iJhYipFiu0nHP9pn+8adU0bWHlKXeU4vJ4Fu5+4O 4xaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EMfToD67; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id jc39-20020a056a006ca700b006bca1443f29si13228484pfb.297.2023.11.16.09.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 09:46:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EMfToD67; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 034D380A3118; Thu, 16 Nov 2023 09:46:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345367AbjKPRpu (ORCPT <rfc822;jaysivo@gmail.com> + 30 others); Thu, 16 Nov 2023 12:45:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjKPRpt (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 16 Nov 2023 12:45:49 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 983581A8 for <linux-kernel@vger.kernel.org>; Thu, 16 Nov 2023 09:45:44 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-32f9268bf8cso822183f8f.0 for <linux-kernel@vger.kernel.org>; Thu, 16 Nov 2023 09:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1700156743; x=1700761543; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=31lYSY2gScfJmzy6bBEtYXDpksRo7piXakrkacNysY0=; b=EMfToD67FrdEb0AvzYukUrvxkA+b8TaYGG6CCqXEGsf3ocONPCh6Ki0NfH5ucIeXhz ExEpDMcdg2ysufqVtOyCbaB1b5jOdizmLsLU4oOSQjgZG6yW4n4JmTF6idIQr3zkjZBX bJIz01HQmYoMB6mYFvLkBPejwwvpEDr7wnKaJku9UZbn3t53XSKl+kVCyWu40IVMMHoz wA16K+AAPxpzxOXXv0thWjMAh55PN4GQzbR7NUh/SdaNIMo2URhe9yjAAAZT6GkxF7cq yUQ3OKNm3ZtH5q1qNMcfK8uBxoM1VkvvDqf254vK1KKDveUPaCqfHl/zfw4M5a0N+XkL NFKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700156743; x=1700761543; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=31lYSY2gScfJmzy6bBEtYXDpksRo7piXakrkacNysY0=; b=lrXOnx408OW2v28+3cFMCmDtv1ALYZP1CE+4MssQre087GffVBOZ1A76QFVjRIibKr O3BFkvBlojXuX0g7kEaKU2V3D0vleEs1xUUHj4N6X4xxX3DbhggGklpKDFo5uY6QVP6S hmtNB2m9THMuyEoYmUWg7kXW2zjC6QxN9JjZKeBPBZZC+nhbxgvfzmMTMtjsNg6o8evF 5XgQA//MOJn0Lw88E9fdnd6NaYTFesXGt5G4+vkXGIi3AdlWiMLxU06ekKPGTjfU/G7o j60RdTylDHd0szc0xjHyCZeYd2cQDD9BWEBFr3JYjPUlLqwb+K8k49uvc/vrnbqaNPCb CexQ== X-Gm-Message-State: AOJu0YxkrEEpnfT3qkeD1Bpm9zEIOx+nGF+YnnUi+j0xoMP1z/Nm5jTg gIRGd+BaQDtXYvAbKpaFMI04+SIa8FbMIoYRxvZVYQ== X-Received: by 2002:a05:6000:178f:b0:32d:84c7:2f56 with SMTP id e15-20020a056000178f00b0032d84c72f56mr13158051wrg.21.1700156742901; Thu, 16 Nov 2023 09:45:42 -0800 (PST) MIME-Version: 1.0 From: Brenton Simpson <appsforartists@google.com> Date: Thu, 16 Nov 2023 09:45:31 -0800 Message-ID: <CAAL3-=88exVfuL1Y-kvPNbsU+d-UTfDLFViWVObFLtbC4xueeA@mail.gmail.com> Subject: [PATCH] Input: xpad - add Lenovo Legion Go controllers To: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Erica Taylor <rickytaylor26@gmail.com>, Vicki Pfau <vi@endrift.com>, nate@yocom.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Ismael Ferreras Morezuelas <swyterzone@gmail.com>, Cameron Gutman <aicommander@gmail.com>, Hans de Goede <hdegoede@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 16 Nov 2023 09:46:04 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782743620739373425 X-GMAIL-MSGID: 1782743620739373425 |
Series |
Input: xpad - add Lenovo Legion Go controllers
|
|
Commit Message
Brenton Simpson
Nov. 16, 2023, 5:45 p.m. UTC
When the controllers are both attached (or detached), they appear as
0x17ef, 0x6182. When only one is attached, they appear as
0x17ef, 0x6184.
84 (mixed attachment) is already recognized as a gamepad by Linux. This
patch adds 82 (both attached/detached).
These controllers have many more buttons than is typical. With this
patch, here's what's functional when it presents as 82:
Recognized:
- X, Y, A, B
- both analog sticks, including L3/R3
- D-pad
- menu and capture buttons
- rumble
Not yet recognized:
- start, select
- 4 rear paddle buttons (Y1, Y2, Y3, M3)
- gyroscope
(There are also non-functional buttons when reporting as 84 that are
out-of-scope for this patch.)
Signed-off-by: Brenton Simpson <appsforartists@google.com>
---
drivers/input/joystick/xpad.c | 2 ++
1 file changed, 2 insertions(+)
Comments
Hi Brenton, On 11/16/23 18:45, Brenton Simpson wrote: > When the controllers are both attached (or detached), they appear as > 0x17ef, 0x6182. When only one is attached, they appear as > 0x17ef, 0x6184. > > 84 (mixed attachment) is already recognized as a gamepad by Linux. This > patch adds 82 (both attached/detached). > > These controllers have many more buttons than is typical. With this > patch, here's what's functional when it presents as 82: > > Recognized: > > - X, Y, A, B > - both analog sticks, including L3/R3 > - D-pad > - menu and capture buttons > - rumble > > Not yet recognized: > > - start, select > - 4 rear paddle buttons (Y1, Y2, Y3, M3) > - gyroscope > > (There are also non-functional buttons when reporting as 84 that are > out-of-scope for this patch.) > > Signed-off-by: Brenton Simpson <appsforartists@google.com> > --- > drivers/input/joystick/xpad.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c > index f5c21565bb3cec..ecfcea8740a009 100644 > --- a/drivers/input/joystick/xpad.c > +++ b/drivers/input/joystick/xpad.c > @@ -127,6 +127,7 @@ static const struct xpad_device { > u8 mapping; > u8 xtype; > } xpad_device[] = { It looks like your workflow of copy-pasting this into your email client has turned the tabs in the patch into a single space character. This and possibly other issues (line-wrapping, wrong end-of-line type) is why using git send-email is the preferred way to submit kernel patches. Maybe try using Brenton Simpson <appsforartists+kernel@google.com> for both the author and signed-off-by fields and then use git send-email ? Regards, Hans p.s. Might be best to send the next attempt just to me, until you've figured out a working email setup. And then once we have things working, re-submit to the right people ? > + { 0x17ef, 0x6182, "Lenovo Legion Go Controller (unified)", 0, XTYPE_XBOX360 }, > { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 }, > { 0x03eb, 0xff01, "Wooting One (Legacy)", 0, XTYPE_XBOX360 }, > { 0x03eb, 0xff02, "Wooting Two (Legacy)", 0, XTYPE_XBOX360 }, > @@ -459,6 +460,7 @@ static const signed short xpad_btn_paddles[] = { > > static const struct usb_device_id xpad_table[] = { > { USB_INTERFACE_INFO('X', 'B', 0) }, /* Xbox USB-IF not-approved class */ > + XPAD_XBOX360_VENDOR(0x17ef), /* Lenovo */ > XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 controller */ > XPAD_XBOX360_VENDOR(0x03eb), /* Wooting Keyboards (Legacy) */ > XPAD_XBOXONE_VENDOR(0x03f0), /* HP HyperX Xbox One controllers */ >
A bunch of internal wrangling and one holiday codefreeze later, my git alias has finally been enabled for send-email. Sorry for the hassle, and thanks for your help. On Thu, Jan 18, 2024 at 10:35 AM Brenton Simpson <appsforartists@google.com> wrote: > > The Lenovo Legion Go is a handheld gaming system, similar to a Steam Deck. > It has a gamepad (including rear paddles), 3 gyroscopes, a trackpad, > volume buttons, a power button, and 2 LED ring lights. > > The Legion Go firmware presents these controls as a USB hub with various > devices attached. In its default state, the gamepad is presented as an > Xbox controller connected to this hub. (By holding a combination of > buttons, it can be changed to use the older DirectInput API.) > > This patch teaches the existing Xbox controller module `xpad` to bind to > the controller in the Legion Go, which enables support for the: > > - directional pad, > - analog sticks (including clicks), > - X, Y, A, B, > - start and select (or menu and capture), > - shoulder buttons, and > - rumble. > > The trackpad, touchscreen, volume controls, and power button are already > supported via existing kernel modules. Two of the face buttons, the > gyroscopes, rear paddles, and LEDs are not. > > After this patch lands, the Legion Go will be mostly functional in Linux, > out-of-the-box. The various components of the USB hub can be synthesized > into a single logical controller (including the additional buttons) in > userspace with [Handheld Daemon](https://github.com/hhd-dev/hhd), which > makes the Go fully functional. > > Signed-off-by: Brenton Simpson <appsforartists@google.com> > --- > drivers/input/joystick/xpad.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c > index f5c21565bb3c..ecfcea8740a0 100644 > --- a/drivers/input/joystick/xpad.c > +++ b/drivers/input/joystick/xpad.c > @@ -127,6 +127,7 @@ static const struct xpad_device { > u8 mapping; > u8 xtype; > } xpad_device[] = { > + { 0x17ef, 0x6182, "Lenovo Legion Controller for Windows", 0, XTYPE_XBOX360 }, > { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 }, > { 0x03eb, 0xff01, "Wooting One (Legacy)", 0, XTYPE_XBOX360 }, > { 0x03eb, 0xff02, "Wooting Two (Legacy)", 0, XTYPE_XBOX360 }, > @@ -459,6 +460,7 @@ static const signed short xpad_btn_paddles[] = { > > static const struct usb_device_id xpad_table[] = { > { USB_INTERFACE_INFO('X', 'B', 0) }, /* Xbox USB-IF not-approved class */ > + XPAD_XBOX360_VENDOR(0x17ef), /* Lenovo */ > XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 controller */ > XPAD_XBOX360_VENDOR(0x03eb), /* Wooting Keyboards (Legacy) */ > XPAD_XBOXONE_VENDOR(0x03f0), /* HP HyperX Xbox One controllers */ > -- > 2.43.0.275.g3460e3d667-goog >
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index f5c21565bb3cec..ecfcea8740a009 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -127,6 +127,7 @@ static const struct xpad_device { u8 mapping; u8 xtype; } xpad_device[] = { + { 0x17ef, 0x6182, "Lenovo Legion Go Controller (unified)", 0, XTYPE_XBOX360 }, { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 }, { 0x03eb, 0xff01, "Wooting One (Legacy)", 0, XTYPE_XBOX360 }, { 0x03eb, 0xff02, "Wooting Two (Legacy)", 0, XTYPE_XBOX360 }, @@ -459,6 +460,7 @@ static const signed short xpad_btn_paddles[] = { static const struct usb_device_id xpad_table[] = { { USB_INTERFACE_INFO('X', 'B', 0) }, /* Xbox USB-IF not-approved class */ + XPAD_XBOX360_VENDOR(0x17ef), /* Lenovo */ XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 controller */ XPAD_XBOX360_VENDOR(0x03eb), /* Wooting Keyboards (Legacy) */ XPAD_XBOXONE_VENDOR(0x03f0), /* HP HyperX Xbox One controllers */