public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Korth <gerbilsoft@gerbilsoft.com>
To: David Rheinsberg <david.rheinsberg@gmail.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] HID: wiimote: Initialize the controller LEDs with a device ID value
Date: Wed, 24 Jun 2020 18:05:38 -0400	[thread overview]
Message-ID: <2498150.lGaqSPkdTl@dek-x230> (raw)
In-Reply-To: <CANq1E4T_SNUrewDQ59bonr7tTKFa=wRYwXLWHMCiNA0KN0H9Aw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2042 bytes --]

On Wednesday, June 24, 2020 6:04:55 AM EDT David Rheinsberg wrote:
> Hi
> 
> On Tue, Jun 23, 2020 at 12:57 AM David Korth <gerbilsoft@gerbilsoft.com> 
wrote:
> > Based on a similar commit for Sony Sixaxis and DualShock 4 controllers:
> > HID: sony: Initialize the controller LEDs with a device ID value
> > 
> > Wii remotes have the same player LED layout as Sixaxis controllers,
> > so the wiimote setup is based on the Sixaxis code.
> 
> Please include a description of the patch in the commit-message. It
> took me quite a while to understand what the intention of this patch
> is.

Will do.

> So what you are trying is to allocate a unique ID to each connected
> wiimote, so they automatically display unique IDs, right?
> 
> Can you explain why this has to be done in the kernel driver? Why
> isn't user-space assigning the right ID? User-space needs to attach
> controllers to their respective engine anyway, in which case the IDs
> the kernel assigns would be wrong, right? How does user-space display
> the matching ID in their UI (e.g., for configuration use-cases)? The
> way you set them does not allow user-space to query the ID, does it?
> Lastly, wouldn't a device-reconnect want the same ID to be assigned
> again? With the logic you apply, user-space would have to override
> every ID for that to work.
> 
> Is there an actual use-case for this? Or is this just to align the
> driver with the other gamepads?

Most userspace programs aren't aware of controller LEDs. The only one I know 
of that is, Steam, has its own input layer and bypasses the HID drivers 
entirely.

As far as I know, there's no simple "set player ID" API that could be used to 
set a device-independent player number, so every program would need to support 
each type of controller in order to set the LEDs.

I've been manually setting the player IDs on Wii controllers when running 
multiplayer games by writing to the /sys/class/leds/ directory. Having the 
hid-wiimote driver do this itself significantly reduces setup time.

> 
> Thanks
> David
> 

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-06-24 22:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 22:57 [PATCH 1/2] HID: wiimote: Initialize the controller LEDs with a device ID value David Korth
2020-06-24 10:04 ` David Rheinsberg
2020-06-24 22:05   ` David Korth [this message]
2020-06-25  7:09     ` David Rheinsberg
2020-06-26  3:57       ` David Korth

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=2498150.lGaqSPkdTl@dek-x230 \
    --to=gerbilsoft@gerbilsoft.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=david.rheinsberg@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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