linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: xpad - fix PowerA EnWired Controller guide button
@ 2022-10-06 22:12 Vicki Pfau
  2022-10-14 13:00 ` Mattijs Korpershoek
  2023-02-25  1:14 ` Lyude Paul
  0 siblings, 2 replies; 5+ messages in thread
From: Vicki Pfau @ 2022-10-06 22:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Michael Cullen, Marcos Alano, linux-input; +Cc: Vicki Pfau

Some Xbox One controllers require more complete versions of the controller
start-up sequence used in official software in order to function properly.
This patch adds a usb_set_interface call that matches official startup and
nominally disabled the audio interface, which isn't supported in the xpad
driver in the first place.

Signed-off-by: Vicki Pfau <vi@endrift.com>
---
 drivers/input/joystick/xpad.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 18190b529bca..6449665d7b61 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -1509,6 +1509,13 @@ static int xpad_start_input(struct usb_xpad *xpad)
 		return -EIO;
 
 	if (xpad->xtype == XTYPE_XBOXONE) {
+		/* 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 */
+		error = usb_set_interface(xpad->udev, 1, 0);
+		if (error)
+			return error;
+
 		error = xpad_start_xbox_one(xpad);
 		if (error) {
 			usb_kill_urb(xpad->irq_in);
-- 
2.38.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-28  0:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-06 22:12 [PATCH] Input: xpad - fix PowerA EnWired Controller guide button Vicki Pfau
2022-10-14 13:00 ` Mattijs Korpershoek
2023-02-25  1:14 ` Lyude Paul
2023-02-25 18:27   ` Dmitry Torokhov
2023-02-28  0:32     ` Vicki Pfau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).