diff mbox series

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

Message ID 20230203022758.3982393-2-vi@endrift.com
State New
Headers show
Series [1/3] Input: xpad - Treat Qanba controllers as Xbox360 controllers | expand

Commit Message

Vicki Pfau Feb. 3, 2023, 2:27 a.m. UTC
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.

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

Comments

Dmitry Torokhov March 24, 2023, 1:29 a.m. UTC | #1
On Thu, Feb 02, 2023 at 06:27:57PM -0800, Vicki Pfau wrote:
> 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.
> 
> 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 bb65c8268963..16bc3cd4c2b7 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -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?

> +	retval = usb_set_interface(xpad->udev, 1, 0);
> +	if (retval)
> +		return retval;
> +
>  	spin_lock_irqsave(&xpad->odata_lock, flags);
>  
>  	/*
> -- 
> 2.39.1
> 

Thanks.
diff mbox series

Patch

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index bb65c8268963..16bc3cd4c2b7 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -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);
 
 	/*