Message ID | 20230203022758.3982393-2-vi@endrift.com (mailing list archive) |
---|---|
State | Under Review |
Headers | show |
Series | [1/3] Input: xpad - Treat Qanba controllers as Xbox360 controllers | expand |
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 --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); /*
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(+)