Skip to contentSkip to conversation

Input: xpad - Treat Qanba controllers as Xbox360 controllers

PATCH In review Vicki Pfau 3 participants 9 messages Feb 3, 2023 – Mar 24, 2023

Subsystems (2)
lore
Share & tools
lore

Vicki Pfau

author
#0 lore raw

PATCH 1/3 Input: xpad - Treat Qanba controllers as Xbox360 controllers

From: "Pierre-Loup A. Griffais" <[email protected]>

They act that way in PC mode.

---
 drivers/input/joystick/xpad.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/joystick/xpad.c +1 -0
index 2959d80f7fdb..bb65c8268963 100644
@@ -492,6 +492,7 @@ static const struct usb_device_id xpad_table[] = {
 	XPAD_XBOXONE_VENDOR(0x24c6),		/* PowerA Controllers */
 	XPAD_XBOX360_VENDOR(0x2563),		/* OneXPlayer Gamepad */
 	XPAD_XBOX360_VENDOR(0x260d),		/* Dareu H101 */
+	XPAD_XBOX360_VENDOR(0x2c22),		/* Qanba Controllers */
 	XPAD_XBOXONE_VENDOR(0x2dc8),		/* 8BitDo Pro 2 Wired Controller for Xbox */
 	XPAD_XBOXONE_VENDOR(0x2e24),		/* Hyperkin Duke X-Box One pad */
 	XPAD_XBOX360_VENDOR(0x2f24),		/* GameSir Controllers */
Signature · 1 line
2.39.1
author
#1 lore raw

PATCH 2/3 Input: xpad - fix PowerA EnWired Controller guide button

This commit explicitly disables the audio interface the same way the official driver does. This is needed for some controllers, such as the PowerA Enhanced Wired Controller for Series X|S (0x20d6:0x200e) to report the guide button.

---
 drivers/input/joystick/xpad.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/input/joystick/xpad.c +7 -0
index bb65c8268963..16bc3cd4c2b7 100644
@@ -1390,6 +1390,13 @@ static int xpad_start_xbox_one(struct usb_xpad *xpad)
 	unsigned long flags;
 	int retval;
 
+	/* Explicitly disable the audio interface. This is needed for some
+	 * controllers, such as the PowerA Enhanced Wired Controller
+	 * for Series X|S (0x20d6:0x200e) to report the guide button */
+	retval = usb_set_interface(xpad->udev, 1, 0);
+	if (retval)
+		return retval;
+
 	spin_lock_irqsave(&xpad->odata_lock, flags);
 
 	/*
Signature · 1 line
2.39.1
maintainer
#2 lore raw

Re: [PATCH 2/3] Input: xpad - fix PowerA EnWired Controller guide button

Quoted 14 lines · Vicki Pfau

This commit explicitly disables the audio interface the same way the official driver does. This is needed for some controllers, such as the PowerA Enhanced Wired Controller for Series X|S (0x20d6:0x200e) to report the guide button.

---
 drivers/input/joystick/xpad.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/input/joystick/xpad.c +0 -0
index bb65c8268963..16bc3cd4c2b7 100644

drivers/input/joystick/xpad.c static int xpad_start_xbox_one(struct usb_xpad *xpad) · line 1395

Quoted 6 lines
drivers/input/joystick/xpad.c +3 -0
@@ -1390,6 +1390,13 @@ static int xpad_start_xbox_one(struct usb_xpad *xpad)
 	unsigned long flags;
 	int retval;
 
+	/* Explicitly disable the audio interface. This is needed for some
+	 * controllers, such as the PowerA Enhanced Wired Controller
+	 * for Series X|S (0x20d6:0x200e) to report the guide button */

Is it guaranteed that there is 2nd interface? Is it always the audio interface?

Quoted 10 lines
drivers/input/joystick/xpad.c +4 -0
+	retval = usb_set_interface(xpad->udev, 1, 0);
+	if (retval)
+		return retval;
+
 	spin_lock_irqsave(&xpad->odata_lock, flags);
 
 	/*
Signature · 1 line
2.39.1

Thanks.

Signature · 1 line
Dmitry
author
#3 lore raw

PATCH 3/3 Input: xpad - add support for 8BitDo Ultimate Wireless controller dongle

In reply to Vicki Pfau

From: "Pierre-Loup A. Griffais" <[email protected]>

Add the VID and PID of the 8BitDo Ultimate Wireless controller dongle

---
 drivers/input/joystick/xpad.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/joystick/xpad.c +2 -0
index 16bc3cd4c2b7..403b57e8176b 100644
@@ -359,6 +359,7 @@ static const struct xpad_device {
 	{ 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
 	{ 0x2563, 0x058d, "OneXPlayer Gamepad", 0, XTYPE_XBOX360 },
 	{ 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE },
+	{ 0x2dc8, 0x3106, "8BitDo Ultimate Wireless Controller", 0, XTYPE_XBOX360 },
 	{ 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 },
 	{ 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 },
 	{ 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
@@ -494,6 +495,7 @@ static const struct usb_device_id xpad_table[] = {
 	XPAD_XBOX360_VENDOR(0x260d),		/* Dareu H101 */
 	XPAD_XBOX360_VENDOR(0x2c22),		/* Qanba Controllers */
 	XPAD_XBOXONE_VENDOR(0x2dc8),		/* 8BitDo Pro 2 Wired Controller for Xbox */
+	XPAD_XBOX360_VENDOR(0x2dc8),		/* 8BitDo Ultimate Wireless Controller */
 	XPAD_XBOXONE_VENDOR(0x2e24),		/* Hyperkin Duke X-Box One pad */
 	XPAD_XBOX360_VENDOR(0x2f24),		/* GameSir Controllers */
 	XPAD_XBOX360_VENDOR(0x31e3),		/* Wooting Keyboards */
Signature · 1 line
2.39.1
maintainer
#4 lore raw

Re: [PATCH 3/3] Input: xpad - add support for 8BitDo Ultimate Wireless controller dongle

Quoted 5 lines · Vicki Pfau

From: "Pierre-Loup A. Griffais" <[email protected]>

Add the VID and PID of the 8BitDo Ultimate Wireless controller dongle

Same issue as the first patch regarding attribution.

Quoted 27 lines
---
 drivers/input/joystick/xpad.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/joystick/xpad.c +2 -0
index 16bc3cd4c2b7..403b57e8176b 100644
@@ -359,6 +359,7 @@ static const struct xpad_device {
 	{ 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
 	{ 0x2563, 0x058d, "OneXPlayer Gamepad", 0, XTYPE_XBOX360 },
 	{ 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE },
+	{ 0x2dc8, 0x3106, "8BitDo Ultimate Wireless Controller", 0, XTYPE_XBOX360 },
 	{ 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 },
 	{ 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 },
 	{ 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
@@ -494,6 +495,7 @@ static const struct usb_device_id xpad_table[] = {
 	XPAD_XBOX360_VENDOR(0x260d),		/* Dareu H101 */
 	XPAD_XBOX360_VENDOR(0x2c22),		/* Qanba Controllers */
 	XPAD_XBOXONE_VENDOR(0x2dc8),		/* 8BitDo Pro 2 Wired Controller for Xbox */
+	XPAD_XBOX360_VENDOR(0x2dc8),		/* 8BitDo Ultimate Wireless Controller */
 	XPAD_XBOXONE_VENDOR(0x2e24),		/* Hyperkin Duke X-Box One pad */
 	XPAD_XBOX360_VENDOR(0x2f24),		/* GameSir Controllers */
 	XPAD_XBOX360_VENDOR(0x31e3),		/* Wooting Keyboards */
Signature · 1 line
2.39.1
Signature · 1 line
Dmitry
Reviewed-by on v1 1/3
#5 lore raw
In reply to Vicki Pfau

LGTM. For onlookers curious: the audio interface being disabled here isn't currently supported in xpad quite yet, but is supported out of tree - supposedly with plans to eventually merge it into the mainline kernel. So patch 2/3 here should be fine.

Anyway,

Quoted 21 lines · Vicki Pfau

From: "Pierre-Loup A. Griffais" <[email protected]>

They act that way in PC mode.

---
 drivers/input/joystick/xpad.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/joystick/xpad.c +1 -0
index 2959d80f7fdb..bb65c8268963 100644
@@ -492,6 +492,7 @@ static const struct usb_device_id xpad_table[] = {
 	XPAD_XBOXONE_VENDOR(0x24c6),		/* PowerA Controllers */
 	XPAD_XBOX360_VENDOR(0x2563),		/* OneXPlayer Gamepad */
 	XPAD_XBOX360_VENDOR(0x260d),		/* Dareu H101 */
+	XPAD_XBOX360_VENDOR(0x2c22),		/* Qanba Controllers */
 	XPAD_XBOXONE_VENDOR(0x2dc8),		/* 8BitDo Pro 2 Wired Controller for Xbox */
 	XPAD_XBOXONE_VENDOR(0x2e24),		/* Hyperkin Duke X-Box One pad */
 	XPAD_XBOX360_VENDOR(0x2f24),		/* GameSir Controllers */
Signature · 3 lines
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat
#6 lore raw

Almost forgot to mention - the Reviewed-by here is for the whole series, not just the first patch :)

Quoted 32 lines · Lyude Paul

LGTM. For onlookers curious: the audio interface being disabled here isn't currently supported in xpad quite yet, but is supported out of tree - supposedly with plans to eventually merge it into the mainline kernel. So patch 2/3 here should be fine.

Anyway,

Quoted 21 lines · Vicki Pfau

From: "Pierre-Loup A. Griffais" <[email protected]>

They act that way in PC mode.

---
 drivers/input/joystick/xpad.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/joystick/xpad.c +1 -0
index 2959d80f7fdb..bb65c8268963 100644
@@ -492,6 +492,7 @@ static const struct usb_device_id xpad_table[] = {
 	XPAD_XBOXONE_VENDOR(0x24c6),		/* PowerA Controllers */
 	XPAD_XBOX360_VENDOR(0x2563),		/* OneXPlayer Gamepad */
 	XPAD_XBOX360_VENDOR(0x260d),		/* Dareu H101 */
+	XPAD_XBOX360_VENDOR(0x2c22),		/* Qanba Controllers */
 	XPAD_XBOXONE_VENDOR(0x2dc8),		/* 8BitDo Pro 2 Wired Controller for Xbox */
 	XPAD_XBOXONE_VENDOR(0x2e24),		/* Hyperkin Duke X-Box One pad */
 	XPAD_XBOX360_VENDOR(0x2f24),		/* GameSir Controllers */
Signature · 3 lines
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat
#7 lore raw
In reply to Vicki Pfau

Hi Dmitry, it looks like this patch series has been sitting for a while now without getting any kind of feedback. Could you please take a look at this the next chance you get?

Quoted 21 lines · Vicki Pfau

From: "Pierre-Loup A. Griffais" <[email protected]>

They act that way in PC mode.

---
 drivers/input/joystick/xpad.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/joystick/xpad.c +1 -0
index 2959d80f7fdb..bb65c8268963 100644
@@ -492,6 +492,7 @@ static const struct usb_device_id xpad_table[] = {
 	XPAD_XBOXONE_VENDOR(0x24c6),		/* PowerA Controllers */
 	XPAD_XBOX360_VENDOR(0x2563),		/* OneXPlayer Gamepad */
 	XPAD_XBOX360_VENDOR(0x260d),		/* Dareu H101 */
+	XPAD_XBOX360_VENDOR(0x2c22),		/* Qanba Controllers */
 	XPAD_XBOXONE_VENDOR(0x2dc8),		/* 8BitDo Pro 2 Wired Controller for Xbox */
 	XPAD_XBOXONE_VENDOR(0x2e24),		/* Hyperkin Duke X-Box One pad */
 	XPAD_XBOX360_VENDOR(0x2f24),		/* GameSir Controllers */
Signature · 3 lines
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat
maintainer
#8 lore raw
In reply to Vicki Pfau
Quoted 5 lines · Vicki Pfau

From: "Pierre-Loup A. Griffais" <[email protected]>

They act that way in PC mode.

Sorry, this patch is a complete mess with regard to the sender, the author, and the person giving their signed-off-by.

Quoted 19 lines
---
 drivers/input/joystick/xpad.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/joystick/xpad.c +1 -0
index 2959d80f7fdb..bb65c8268963 100644
@@ -492,6 +492,7 @@ static const struct usb_device_id xpad_table[] = {
 	XPAD_XBOXONE_VENDOR(0x24c6),		/* PowerA Controllers */
 	XPAD_XBOX360_VENDOR(0x2563),		/* OneXPlayer Gamepad */
 	XPAD_XBOX360_VENDOR(0x260d),		/* Dareu H101 */
+	XPAD_XBOX360_VENDOR(0x2c22),		/* Qanba Controllers */
 	XPAD_XBOXONE_VENDOR(0x2dc8),		/* 8BitDo Pro 2 Wired Controller for Xbox */
 	XPAD_XBOXONE_VENDOR(0x2e24),		/* Hyperkin Duke X-Box One pad */
 	XPAD_XBOX360_VENDOR(0x2f24),		/* GameSir Controllers */
Signature · 1 line
2.39.1

Thanks.

Signature · 1 line
Dmitry