2023-11-16 17:46:05

by Brenton Simpson

[permalink] [raw]
Subject: [PATCH] Input: xpad - add Lenovo Legion Go controllers

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 <[email protected]>
---
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[] = {
+ { 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 */


2023-11-16 18:21:03

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - add Lenovo Legion Go controllers

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 <[email protected]>
> ---
> 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 <[email protected]>

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 */
>

2024-01-18 18:36:23

by Brenton Simpson

[permalink] [raw]
Subject: [PATCH] Input: xpad - add Lenovo Legion Go controllers

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 <[email protected]>
---
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


2024-01-18 18:42:01

by Brenton Simpson

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - add Lenovo Legion Go 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
<[email protected]> 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 <[email protected]>
> ---
> 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
>

2024-01-19 06:17:02

by Vicki Pfau

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - add Lenovo Legion Go controllers

Hi Brenton,

On 1/18/24 10:35, Brenton Simpson 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 <[email protected]>
> ---
> 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 },

Please keep the items in this list sorted.

> @@ -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 */

Ditto here.

Dmitry will sometimes take patches and fix the sorting after they're
submitted so you might not to resubmit, but for future reference, this
list is intended to be sorted.

Vicki

2024-01-19 08:31:13

by Brenton Simpson

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - add Lenovo Legion Go controllers

Thanks Vicki. I didn't realize they were meant to be sorted.

Would it be appropriate to add comments explaining the sorting? The
second stanza, in particular, is sorted by the IDs rather than
lexicographically. If someone sorted it naively, they'd end up with a
bigger diff than expected.

It looks like a few others have escaped sorting; for instance,
"Microsoft X-Box One Elite 2 pad" appears in the wrong place.

If Dmitry wants to land this and then follow on with a sort + comment
commit (or do that first and then rebase this on top), that would be
great. I can take a stab too if that's helpful.


On Thu, Jan 18, 2024 at 10:16 PM Vicki Pfau <[email protected]> wrote:
>
> Hi Brenton,
>
> On 1/18/24 10:35, Brenton Simpson 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 <[email protected]>
> > ---
> > 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 },
>
> Please keep the items in this list sorted.
>
> > @@ -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 */
>
> Ditto here.
>
> Dmitry will sometimes take patches and fix the sorting after they're
> submitted so you might not to resubmit, but for future reference, this
> list is intended to be sorted.
>
> Vicki

2024-01-30 22:32:35

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - add Lenovo Legion Go controllers

Hi Brenton,

On Fri, Jan 19, 2024 at 12:22:45AM -0800, Brenton Simpson wrote:
> Thanks Vicki. I didn't realize they were meant to be sorted.

Please try avoid top posting.

>
> Would it be appropriate to add comments explaining the sorting? The
> second stanza, in particular, is sorted by the IDs rather than
> lexicographically. If someone sorted it naively, they'd end up with a
> bigger diff than expected.

Yes, we usually sort by VID/PID rather than the name of the device.

>
> It looks like a few others have escaped sorting; for instance,
> "Microsoft X-Box One Elite 2 pad" appears in the wrong place.

Yep, sometimes we mess up.

>
> If Dmitry wants to land this and then follow on with a sort + comment
> commit (or do that first and then rebase this on top), that would be
> great. I can take a stab too if that's helpful.

I applied the patch (moving the entires to the right place). If someone
would send a patch fixing the Elite 2 entry and noting the sorting rules
I'd be happy to apply it.

Thanks.

--
Dmitry

2024-01-30 23:20:47

by Brenton Simpson

[permalink] [raw]
Subject: [PATCH] Input: xpad - sort xpad_device by vendor and product ID

Signed-off-by: Brenton Simpson <[email protected]>
---
drivers/input/joystick/xpad.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 7c4b2a5cc1b5..c67f3d65192d 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[] = {
+ /* Please keep this list sorted by vendor and product ID. */
{ 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 },
@@ -147,9 +148,9 @@ static const struct xpad_device {
{ 0x045e, 0x02d1, "Microsoft X-Box One pad", 0, XTYPE_XBOXONE },
{ 0x045e, 0x02dd, "Microsoft X-Box One pad (Firmware 2015)", 0, XTYPE_XBOXONE },
{ 0x045e, 0x02e3, "Microsoft X-Box One Elite pad", MAP_PADDLES, XTYPE_XBOXONE },
- { 0x045e, 0x0b00, "Microsoft X-Box One Elite 2 pad", MAP_PADDLES, XTYPE_XBOXONE },
{ 0x045e, 0x02ea, "Microsoft X-Box One S pad", 0, XTYPE_XBOXONE },
{ 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
+ { 0x045e, 0x0b00, "Microsoft X-Box One Elite 2 pad", MAP_PADDLES, XTYPE_XBOXONE },
{ 0x045e, 0x0b0a, "Microsoft X-Box Adaptive Controller", MAP_PROFILE_BUTTON, XTYPE_XBOXONE },
{ 0x045e, 0x0b12, "Microsoft Xbox Series S|X Controller", MAP_SELECT_BUTTON, XTYPE_XBOXONE },
{ 0x046d, 0xc21d, "Logitech Gamepad F310", 0, XTYPE_XBOX360 },
@@ -335,7 +336,6 @@ static const struct xpad_device {
{ 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE },
{ 0x20d6, 0x2009, "PowerA Enhanced Wired Controller for Xbox Series X|S", 0, XTYPE_XBOXONE },
{ 0x20d6, 0x281f, "PowerA Wired Controller For Xbox 360", 0, XTYPE_XBOX360 },
- { 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE },
{ 0x24c6, 0x5000, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
{ 0x24c6, 0x5300, "PowerA MINI PROEX Controller", 0, XTYPE_XBOX360 },
{ 0x24c6, 0x5303, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 },
@@ -350,9 +350,9 @@ static const struct xpad_device {
{ 0x24c6, 0x5502, "Hori Fighting Stick VX Alt", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
{ 0x24c6, 0x5503, "Hori Fighting Edge", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
{ 0x24c6, 0x5506, "Hori SOULCALIBUR V Stick", 0, XTYPE_XBOX360 },
- { 0x24c6, 0x5510, "Hori Fighting Commander ONE (Xbox 360/PC Mode)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
{ 0x24c6, 0x550d, "Hori GEM Xbox controller", 0, XTYPE_XBOX360 },
{ 0x24c6, 0x550e, "Hori Real Arcade Pro V Kai 360", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
+ { 0x24c6, 0x5510, "Hori Fighting Commander ONE (Xbox 360/PC Mode)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
{ 0x24c6, 0x551a, "PowerA FUSION Pro Controller", 0, XTYPE_XBOXONE },
{ 0x24c6, 0x561a, "PowerA FUSION Controller", 0, XTYPE_XBOXONE },
{ 0x24c6, 0x5b00, "ThrustMaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 },
@@ -363,6 +363,7 @@ static const struct xpad_device {
{ 0x2563, 0x058d, "OneXPlayer Gamepad", 0, XTYPE_XBOX360 },
{ 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE },
{ 0x2dc8, 0x3106, "8BitDo Pro 2 Wired Controller", 0, XTYPE_XBOX360 },
+ { 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE },
{ 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 },
{ 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 },
{ 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
@@ -460,6 +461,9 @@ static const signed short xpad_btn_paddles[] = {
{ XPAD_XBOXONE_VENDOR_PROTOCOL((vend), 208) }

static const struct usb_device_id xpad_table[] = {
+ /* Please keep this list sorted by vendor ID. Because the lines use different
+ * macros, you may need to sort it by hand.
+ */
{ USB_INTERFACE_INFO('X', 'B', 0) }, /* Xbox USB-IF not-approved class */
XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 controller */
XPAD_XBOX360_VENDOR(0x03eb), /* Wooting Keyboards (Legacy) */
--
2.43.0.429.g432eaa2c6b-goog


2024-02-09 18:56:41

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - sort xpad_device by vendor and product ID

Hi Brenton,

On Tue, Jan 30, 2024 at 11:19:03PM +0000, Brenton Simpson wrote:
> Signed-off-by: Brenton Simpson <[email protected]>

Empty patch descriptions are frowned upon. You should be able to add at
least a single sentence why the change is being made.

..

>
> static const struct usb_device_id xpad_table[] = {
> + /* Please keep this list sorted by vendor ID. Because the lines use different
> + * macros, you may need to sort it by hand.
> + */

Kernel style of multi-line comments is:

/*
* line 1
* line 2.
*/

I adjusted and applied, thank you.

Thanks.

--
Dmitry

2024-02-09 19:29:04

by Brenton Simpson

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - sort xpad_device by vendor and product ID

On Fri, Feb 9, 2024 at 10:56 AM Dmitry Torokhov
<[email protected]> wrote:
> Kernel style of multi-line comments is:
>
> /*
> * line 1
> * line 2.
> */
>
> I adjusted and applied, thank you.

Thanks!

I did scroll up to check comment style before I added those, but I
must have caught one of the ones that's out of spec. ????