2019-06-09 19:10:54

by Jacek Anaszewski

[permalink] [raw]
Subject: [PATCH v5 03/26] dt-bindings: leds: Add LED_FUNCTION definitions

Add initial set of common LED function definitions.

Signed-off-by: Jacek Anaszewski <[email protected]>
Cc: Baolin Wang <[email protected]>
Cc: Daniel Mack <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Oleh Kravchenko <[email protected]>
Cc: Sakari Ailus <[email protected]>
Cc: Simon Shields <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Reviewed-by: Dan Murphy <[email protected]>
---
include/dt-bindings/leds/common.h | 44 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h
index 217ee9e0dd6c..9e1256a7c1bf 100644
--- a/include/dt-bindings/leds/common.h
+++ b/include/dt-bindings/leds/common.h
@@ -3,8 +3,9 @@
* This header provides macros for the common LEDs device tree bindings.
*
* Copyright (C) 2015, Samsung Electronics Co., Ltd.
- *
* Author: Jacek Anaszewski <[email protected]>
+ *
+ * Copyright (C) 2019 Jacek Anaszewski <[email protected]>
*/

#ifndef __DT_BINDINGS_LEDS_H
@@ -30,4 +31,45 @@
#define LED_COLOR_ID_IR 7
#define LED_COLOR_ID_MAX 8

+/* Standard LED functions */
+#define LED_FUNCTION_ACTIVITY "activity"
+#define LED_FUNCTION_ALARM "alarm"
+#define LED_FUNCTION_BACKLIGHT "backlight"
+#define LED_FUNCTION_BLUETOOTH "bluetooth"
+#define LED_FUNCTION_BOOT "boot"
+#define LED_FUNCTION_CPU "cpu"
+#define LED_FUNCTION_CAPSLOCK "capslock"
+#define LED_FUNCTION_CHARGING "charging"
+#define LED_FUNCTION_DEBUG "debug"
+#define LED_FUNCTION_DISK "disk"
+#define LED_FUNCTION_DISK_ACTIVITY "disk-activity"
+#define LED_FUNCTION_DISK_ERR "disk-err"
+#define LED_FUNCTION_DISK_READ "disk-read"
+#define LED_FUNCTION_DISK_WRITE "disk-write"
+#define LED_FUNCTION_FAULT "fault"
+#define LED_FUNCTION_FLASH "flash"
+#define LED_FUNCTION_HEARTBEAT "heartbeat"
+#define LED_FUNCTION_INDICATOR "indicator"
+#define LED_FUNCTION_KBD_BACKLIGHT "kbd_backlight"
+#define LED_FUNCTION_LAN "lan"
+#define LED_FUNCTION_MAIL "mail"
+#define LED_FUNCTION_MTD "mtd"
+#define LED_FUNCTION_MICMUTE "micmute"
+#define LED_FUNCTION_MUTE "mute"
+#define LED_FUNCTION_NUMLOCK "numlock"
+#define LED_FUNCTION_PANIC "panic"
+#define LED_FUNCTION_PROGRAMMING "programming"
+#define LED_FUNCTION_POWER "power"
+#define LED_FUNCTION_RX "rx"
+#define LED_FUNCTION_SD "sd"
+#define LED_FUNCTION_SCROLLLOCK "scrolllock"
+#define LED_FUNCTION_STANDBY "standby"
+#define LED_FUNCTION_STATUS "status"
+#define LED_FUNCTION_TORCH "torch"
+#define LED_FUNCTION_TX "tx"
+#define LED_FUNCTION_USB "usb"
+#define LED_FUNCTION_WAN "wan"
+#define LED_FUNCTION_WLAN "wlan"
+#define LED_FUNCTION_WPS "wps"
+
#endif /* __DT_BINDINGS_LEDS_H */
--
2.11.0


2019-11-15 13:04:32

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v5 03/26] dt-bindings: leds: Add LED_FUNCTION definitions

Hi Jacek,

On Sun, Jun 9, 2019 at 9:09 PM Jacek Anaszewski
<[email protected]> wrote:
> Add initial set of common LED function definitions.
>
> Signed-off-by: Jacek Anaszewski <[email protected]>

> --- a/include/dt-bindings/leds/common.h
> +++ b/include/dt-bindings/leds/common.h
> @@ -30,4 +31,45 @@
> #define LED_COLOR_ID_IR 7
> #define LED_COLOR_ID_MAX 8
>
> +/* Standard LED functions */
> +#define LED_FUNCTION_ACTIVITY "activity"

What's the appropriate function for "general purpose" or "user" LEDs on
development boards, where the LEDs don't have fixed functions, unlike
on real products?
Perhaps just LED_FUNCTION_INDICATOR?

I noticed your very initial submission defined LED_FUNCTION_USER "user".
I couldn't find an explanation for the rationale behind its removal in later
revisions, or any discussion asking for that.

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2019-11-15 20:16:32

by Jacek Anaszewski

[permalink] [raw]
Subject: Re: [PATCH v5 03/26] dt-bindings: leds: Add LED_FUNCTION definitions

Hi Geert,

On 11/15/19 2:01 PM, Geert Uytterhoeven wrote:
> Hi Jacek,
>
> On Sun, Jun 9, 2019 at 9:09 PM Jacek Anaszewski
> <[email protected]> wrote:
>> Add initial set of common LED function definitions.
>>
>> Signed-off-by: Jacek Anaszewski <[email protected]>
>
>> --- a/include/dt-bindings/leds/common.h
>> +++ b/include/dt-bindings/leds/common.h
>> @@ -30,4 +31,45 @@
>> #define LED_COLOR_ID_IR 7
>> #define LED_COLOR_ID_MAX 8
>>
>> +/* Standard LED functions */
>> +#define LED_FUNCTION_ACTIVITY "activity"
>
> What's the appropriate function for "general purpose" or "user" LEDs on
> development boards, where the LEDs don't have fixed functions, unlike
> on real products?
> Perhaps just LED_FUNCTION_INDICATOR?

LED_FUNCTION_INDICATOR was introduced to address current occurrences
of indicator LEDs that are customary for LED flash controllers.
Such LEDs usually indicate that camera sensor is capturing images.
In the v5 of the patch set [0] I proposed also a documentation for
LED functions but there was little interest in it and no broader
discussion took place, so I didn't apply it.

It would be good to include that finally to avoid abusing the LED names
for irrelevant use cases.

> I noticed your very initial submission defined LED_FUNCTION_USER "user".
> I couldn't find an explanation for the rationale behind its removal in later
> revisions, or any discussion asking for that.

I was asked at some point to give rationale for standardizing particular
LED names and couldn't have come up with anything convincing for "user".
This is however an initial set of standard LED names, so we can always
add new ones. If you like please submit a patch adding what you deem
is missing.

[0]
https://lore.kernel.org/linux-leds/[email protected]/

--
Best regards,
Jacek Anaszewski

2019-11-25 18:45:24

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH v5 03/26] dt-bindings: leds: Add LED_FUNCTION definitions

On Fri 2019-11-15 14:01:50, Geert Uytterhoeven wrote:
> Hi Jacek,
>
> On Sun, Jun 9, 2019 at 9:09 PM Jacek Anaszewski
> <[email protected]> wrote:
> > Add initial set of common LED function definitions.
> >
> > Signed-off-by: Jacek Anaszewski <[email protected]>
>
> > --- a/include/dt-bindings/leds/common.h
> > +++ b/include/dt-bindings/leds/common.h
> > @@ -30,4 +31,45 @@
> > #define LED_COLOR_ID_IR 7
> > #define LED_COLOR_ID_MAX 8
> >
> > +/* Standard LED functions */
> > +#define LED_FUNCTION_ACTIVITY "activity"
>
> What's the appropriate function for "general purpose" or "user" LEDs on
> development boards, where the LEDs don't have fixed functions, unlike
> on real products?
> Perhaps just LED_FUNCTION_INDICATOR?

I'd prefer such LEDs to not exist :-).

> I noticed your very initial submission defined LED_FUNCTION_USER "user".
> I couldn't find an explanation for the rationale behind its removal in later
> revisions, or any discussion asking for that.

There are "user" leds even on non-development boads... one is labeled
"scroll lock".

For the development board, I'd actually prefer to assign some
reasonable functions. If vendor BSP uses the LEDs for disk and network
indicators (for example) I'd just mark it as a disk and network
LEDs...

Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Attachments:
(No filename) (1.48 kB)
signature.asc (188.00 B)
Digital signature
Download all attachments