From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Vicki Pfau <vi@endrift.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>,
linux-input@vger.kernel.org, Pavel Rojtberg <rojtberg@gmail.com>
Subject: Re: [PATCH 2/2] Input: xpad - fix PowerA EnWired Controller guide button
Date: Sun, 9 Apr 2023 19:09:02 -0700 [thread overview]
Message-ID: <ZDNvvtfhjcS4x8f4@google.com> (raw)
In-Reply-To: <a02e0ba4-4ea7-40a0-1d33-8f87f2fe8f2f@endrift.com>
On Wed, Apr 05, 2023 at 07:40:32PM -0700, Vicki Pfau wrote:
>
>
> On 4/1/23 14:41, Dmitry Torokhov wrote:
> > On Wed, Mar 29, 2023 at 07:47:52PM -0700, 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 | 8 ++++++++
> >> 1 file changed, 8 insertions(+)
> >>
> >> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> >> index 698224e1948f..c31fc4e9b310 100644
> >> --- a/drivers/input/joystick/xpad.c
> >> +++ b/drivers/input/joystick/xpad.c
> >> @@ -1396,6 +1396,14 @@ 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, GIP_WIRED_INTF_AUDIO, 0);
> >> + if (retval)
> >> + dev_warn(&xpad->dev->dev,
> >> + "unable to disable audio interface: %d\n", retval);
> >
> > I would prefer if we first validated that the interface is in fact
> > present. Can we do something like:
> >
> > if (usb_ifnum_to_if(xpad->udev, GIP_WIRED_INTF_AUDIO)) {
> > error = usb_set_interface(xpad->udev, GIP_WIRED_INTF_AUDIO, 0);
> > if (error)
> > ...
> > }
> >
>
> Yup, that makes sense. Wasn't sure what the cleanest way to do that was, though I'm unconvinced that the first party driver would work without this interface. It can't hurt to add the check.
>
> Should I resubmit both patches in the series, or just this one?
Both please.
Thanks.
--
Dmitry
prev parent reply other threads:[~2023-04-10 2:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-30 2:47 [PATCH 0/2] Improve GIP support Vicki Pfau
2023-03-30 2:47 ` [PATCH 1/2] Input: xpad - Add constants for GIP interface numbers Vicki Pfau
2023-03-30 2:47 ` [PATCH 2/2] Input: xpad - fix PowerA EnWired Controller guide button Vicki Pfau
2023-04-01 21:41 ` Dmitry Torokhov
2023-04-06 2:40 ` Vicki Pfau
2023-04-10 2:09 ` Dmitry Torokhov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZDNvvtfhjcS4x8f4@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=linux-input@vger.kernel.org \
--cc=rojtberg@gmail.com \
--cc=vi@endrift.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).