linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Valentin <benpicco@googlemail.com>
To: Cameron Gutman <aicommander@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, Lee Jones <lee.jones@linaro.org>
Subject: Re: Input: xpad - add more Xbox one controller IDs
Date: Sun, 14 Nov 2021 20:51:22 +0100	[thread overview]
Message-ID: <20211114205122.575567c6@rechenknecht2k11> (raw)
In-Reply-To: <dd40fcf9-582f-d5fd-4eec-ef06a8ecdf3b@gmail.com>

On Sat, 13 Nov 2021 19:34:54 -0600
Cameron Gutman <aicommander@gmail.com> wrote:

> For 1, the way Windows does it is via the Microsoft OS descriptor [0].
> AFAIK, the specific OS descriptor strings are "XUSB20" for Xbox 360
> and "XGIP10" for Xbox One.
> 
> That functionality is handled by xpad_table[] and the
> bInterfaceProtocol detection logic in xpad_probe(). The xpad_device[]
> entry isn't required for detection or functionality of devices,
> unless those devices need special treatment like
> MAP_TRIGGERS_TO_BUTTONS or something.

The problem is that the gamepad then gets assigned the type
XTYPE_UNKNOWN which excludes it from all run-time code path switches.

E.g. if I comment out

//    { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, XTYPE_XBOX360 },

my X-Box 360 pad will not only lose any LED or rumble support, it will
also not report any input events with jstest because
xpad360_process_packet() is no longer called.

I'll try to check on how to read out the OS descriptor string, maybe
that allows us to detect the type on init and provide a better default
experience.

Best,
Benjamin

  reply	other threads:[~2021-11-14 19:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-13 12:17 Input: xpad - add more Xbox one controller IDs Benjamin Valentin
2021-11-13 12:20 ` [PATCH] Input: xpad - remove 'rumble support' from TODO Benjamin Valentin
2021-11-14  1:34 ` Input: xpad - add more Xbox one controller IDs Cameron Gutman
2021-11-14 19:51   ` Benjamin Valentin [this message]
2021-11-14 20:37     ` Benjamin Valentin
2021-11-14 21:14       ` Cameron Gutman
2021-11-16 15:52         ` Benjamin Valentin
2021-11-14 21:05     ` Cameron Gutman

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=20211114205122.575567c6@rechenknecht2k11 \
    --to=benpicco@googlemail.com \
    --cc=aicommander@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-input@vger.kernel.org \
    /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).