[2/3] leds: add new LED_FUNCTION_PLAYER for player LEDs for game controllers.

Message ID 20210602061253.5747-3-roderick@gaikai.com
State New
Headers show
Series
  • HID: playstation: add LED support.
Related show

Commit Message

Roderick Colenbrander June 2, 2021, 6:12 a.m.
From: Roderick Colenbrander <roderick.colenbrander@sony.com>

Player LEDs are commonly found on game controllers from Nintendo and Sony
to indicate a player ID across a number of LEDs. For example, "Player 2"
might be indicated as "-x--" on a device with 4 LEDs where "x" means on.

This patch introduces a new LED_FUNCTION_PLAYER to properly indicate
player LEDs from the kernel. Until now there was no good standard, which
resulted in inconsistent behavior across xpad, hid-sony, hid-wiimote and
other drivers. Moving forward new drivers should use LED_FUNCTION_PLAYER.

Note: management of Player IDs is left to user space, though a kernel
driver may pick a default value.

Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
---
 include/dt-bindings/leds/common.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jiri Kosina June 24, 2021, 1:25 p.m. | #1
On Tue, 1 Jun 2021, Roderick Colenbrander wrote:

> From: Roderick Colenbrander <roderick.colenbrander@sony.com>

> 

> Player LEDs are commonly found on game controllers from Nintendo and Sony

> to indicate a player ID across a number of LEDs. For example, "Player 2"

> might be indicated as "-x--" on a device with 4 LEDs where "x" means on.

> 

> This patch introduces a new LED_FUNCTION_PLAYER to properly indicate

> player LEDs from the kernel. Until now there was no good standard, which

> resulted in inconsistent behavior across xpad, hid-sony, hid-wiimote and

> other drivers. Moving forward new drivers should use LED_FUNCTION_PLAYER.

> 

> Note: management of Player IDs is left to user space, though a kernel

> driver may pick a default value.

> 

> Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>

> ---

>  include/dt-bindings/leds/common.h | 3 +++

>  1 file changed, 3 insertions(+)

> 

> diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h

> index 52b619d44ba2..94999c250e4d 100644

> --- a/include/dt-bindings/leds/common.h

> +++ b/include/dt-bindings/leds/common.h

> @@ -60,6 +60,9 @@

>  #define LED_FUNCTION_MICMUTE "micmute"

>  #define LED_FUNCTION_MUTE "mute"

>  

> +/* Used for player LEDs as found on game controllers from e.g. Nintendo, Sony. */

> +#define LED_FUNCTION_PLAYER "player"

> +

>  /* Miscelleaus functions. Use functions above if you can. */

>  #define LED_FUNCTION_ACTIVITY "activity"

>  #define LED_FUNCTION_ALARM "alarm"


Pavel, can I please get your Ack on this one, so that I can take it with 
the rest of the series?

Thanks,

-- 
Jiri Kosina
SUSE Labs
Roderick Colenbrander July 6, 2021, 4:51 a.m. | #2
Hi Pavel,

Any feedback on this patch, which introduces a new player led type,
which is common on game controllers?

Thanks,
Roderick Colenbrander

On Thu, Jun 24, 2021 at 6:26 AM Jiri Kosina <jikos@kernel.org> wrote:
>

> On Tue, 1 Jun 2021, Roderick Colenbrander wrote:

>

> > From: Roderick Colenbrander <roderick.colenbrander@sony.com>

> >

> > Player LEDs are commonly found on game controllers from Nintendo and Sony

> > to indicate a player ID across a number of LEDs. For example, "Player 2"

> > might be indicated as "-x--" on a device with 4 LEDs where "x" means on.

> >

> > This patch introduces a new LED_FUNCTION_PLAYER to properly indicate

> > player LEDs from the kernel. Until now there was no good standard, which

> > resulted in inconsistent behavior across xpad, hid-sony, hid-wiimote and

> > other drivers. Moving forward new drivers should use LED_FUNCTION_PLAYER.

> >

> > Note: management of Player IDs is left to user space, though a kernel

> > driver may pick a default value.

> >

> > Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>

> > ---

> >  include/dt-bindings/leds/common.h | 3 +++

> >  1 file changed, 3 insertions(+)

> >

> > diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h

> > index 52b619d44ba2..94999c250e4d 100644

> > --- a/include/dt-bindings/leds/common.h

> > +++ b/include/dt-bindings/leds/common.h

> > @@ -60,6 +60,9 @@

> >  #define LED_FUNCTION_MICMUTE "micmute"

> >  #define LED_FUNCTION_MUTE "mute"

> >

> > +/* Used for player LEDs as found on game controllers from e.g. Nintendo, Sony. */

> > +#define LED_FUNCTION_PLAYER "player"

> > +

> >  /* Miscelleaus functions. Use functions above if you can. */

> >  #define LED_FUNCTION_ACTIVITY "activity"

> >  #define LED_FUNCTION_ALARM "alarm"

>

> Pavel, can I please get your Ack on this one, so that I can take it with

> the rest of the series?

>

> Thanks,

>

> --

> Jiri Kosina

> SUSE Labs

>
Roderick Colenbrander July 22, 2021, 4:22 p.m. | #3
Hi Pavel,

Any update on this topic?

Thanks,
Roderick

On Mon, Jul 5, 2021 at 9:51 PM Roderick Colenbrander
<thunderbird2k@gmail.com> wrote:
>
> Hi Pavel,
>
> Any feedback on this patch, which introduces a new player led type,
> which is common on game controllers?
>
> Thanks,
> Roderick Colenbrander
>
> On Thu, Jun 24, 2021 at 6:26 AM Jiri Kosina <jikos@kernel.org> wrote:
> >
> > On Tue, 1 Jun 2021, Roderick Colenbrander wrote:
> >
> > > From: Roderick Colenbrander <roderick.colenbrander@sony.com>
> > >
> > > Player LEDs are commonly found on game controllers from Nintendo and Sony
> > > to indicate a player ID across a number of LEDs. For example, "Player 2"
> > > might be indicated as "-x--" on a device with 4 LEDs where "x" means on.
> > >
> > > This patch introduces a new LED_FUNCTION_PLAYER to properly indicate
> > > player LEDs from the kernel. Until now there was no good standard, which
> > > resulted in inconsistent behavior across xpad, hid-sony, hid-wiimote and
> > > other drivers. Moving forward new drivers should use LED_FUNCTION_PLAYER.
> > >
> > > Note: management of Player IDs is left to user space, though a kernel
> > > driver may pick a default value.
> > >
> > > Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
> > > ---
> > >  include/dt-bindings/leds/common.h | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h
> > > index 52b619d44ba2..94999c250e4d 100644
> > > --- a/include/dt-bindings/leds/common.h
> > > +++ b/include/dt-bindings/leds/common.h
> > > @@ -60,6 +60,9 @@
> > >  #define LED_FUNCTION_MICMUTE "micmute"
> > >  #define LED_FUNCTION_MUTE "mute"
> > >
> > > +/* Used for player LEDs as found on game controllers from e.g. Nintendo, Sony. */
> > > +#define LED_FUNCTION_PLAYER "player"
> > > +
> > >  /* Miscelleaus functions. Use functions above if you can. */
> > >  #define LED_FUNCTION_ACTIVITY "activity"
> > >  #define LED_FUNCTION_ALARM "alarm"
> >
> > Pavel, can I please get your Ack on this one, so that I can take it with
> > the rest of the series?
> >
> > Thanks,
> >
> > --
> > Jiri Kosina
> > SUSE Labs
> >

Patch

diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h
index 52b619d44ba2..94999c250e4d 100644
--- a/include/dt-bindings/leds/common.h
+++ b/include/dt-bindings/leds/common.h
@@ -60,6 +60,9 @@ 
 #define LED_FUNCTION_MICMUTE "micmute"
 #define LED_FUNCTION_MUTE "mute"
 
+/* Used for player LEDs as found on game controllers from e.g. Nintendo, Sony. */
+#define LED_FUNCTION_PLAYER "player"
+
 /* Miscelleaus functions. Use functions above if you can. */
 #define LED_FUNCTION_ACTIVITY "activity"
 #define LED_FUNCTION_ALARM "alarm"