diff mbox series

dt-bindings: leds: Document commonly used LED triggers

Message ID 20201210061431.23144-1-manivannan.sadhasivam@linaro.org
State Superseded, archived
Headers show
Series dt-bindings: leds: Document commonly used LED triggers | expand

Checks

Context Check Description
robh/checkpatch success
robh/dt-meta-schema success
robh/dtbs-check fail build log

Commit Message

Manivannan Sadhasivam Dec. 10, 2020, 6:14 a.m. UTC
This commit documents the LED triggers used commonly in the SoCs. Not
all triggers are documented as some of them are very application specific.
Most of the triggers documented here are currently used in devicetrees
of many SoCs.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 .../devicetree/bindings/leds/common.yaml      | 72 ++++++++++++++-----
 1 file changed, 54 insertions(+), 18 deletions(-)

Comments

Leizhen (ThunderTown) Dec. 10, 2020, 6:57 a.m. UTC | #1
On 2020/12/10 14:14, Manivannan Sadhasivam wrote:
> This commit documents the LED triggers used commonly in the SoCs. Not
> all triggers are documented as some of them are very application specific.
> Most of the triggers documented here are currently used in devicetrees
> of many SoCs.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>  .../devicetree/bindings/leds/common.yaml      | 72 ++++++++++++++-----
>  1 file changed, 54 insertions(+), 18 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml
> index f1211e7045f1..eee4eb7a4535 100644
> --- a/Documentation/devicetree/bindings/leds/common.yaml
> +++ b/Documentation/devicetree/bindings/leds/common.yaml
> @@ -79,24 +79,60 @@ properties:
>        the LED.
>      $ref: /schemas/types.yaml#definitions/string
>  
> -    enum:
> -        # LED will act as a back-light, controlled by the framebuffer system
> -      - backlight
> -        # LED will turn on (but for leds-gpio see "default-state" property in
> -        # Documentation/devicetree/bindings/leds/leds-gpio.yaml)
> -      - default-on
> -        # LED "double" flashes at a load average based rate
> -      - heartbeat
> -        # LED indicates disk activity
> -      - disk-activity
> -        # LED indicates IDE disk activity (deprecated), in new implementations
> -        # use "disk-activity"
> -      - ide-disk
> -        # LED flashes at a fixed, configurable rate
> -      - timer
> -        # LED alters the brightness for the specified duration with one software
> -        # timer (requires "led-pattern" property)
> -      - pattern
> +    oneOf:
> +      - items:
> +          - enum:
> +                # LED will act as a back-light, controlled by the framebuffer system
> +              - backlight
> +                # LED will turn on (but for leds-gpio see "default-state" property in
> +                # Documentation/devicetree/bindings/leds/leds-gpio.yaml)
> +              - default-on
> +                # LED "double" flashes at a load average based rate
> +              - heartbeat
> +                # LED indicates disk activity
> +              - disk-activity
> +                # LED indicates IDE disk activity (deprecated), in new implementations
> +                # use "disk-activity"
> +              - ide-disk
> +                # LED flashes at a fixed, configurable rate
> +              - timer
> +                # LED alters the brightness for the specified duration with one software
> +                # timer (requires "led-pattern" property)
> +              - pattern
> +                # LED indicates camera flash state
> +              - flash
> +                # LED indicates camera torch state
> +              - torch
> +                # LED indicates audio mute state
> +              - audio-mute
> +                # LED indicates mic mute state
> +              - audio-micmute
> +                # LED indicates bluetooth power state
> +              - bluetooth-power
> +                # LED indicates USB gadget activity
> +              - usb-gadget
> +                # LED indicates USB host activity
> +              - usb-host
> +                # LED indicates MTD memory activity
> +              - mtd
> +                # LED indicates NAND memory activity (deprecated),
> +                # in new implementations use "mtd"
> +              - nand-disk
> +                # LED indicates disk read activity
> +              - disk-read
> +                # LED indicates disk write activity
> +              - disk-write
> +                # No trigger assigned to the LED. This is the default mode
> +                # if trigger is absent
> +              - none
> +                # LED indicates activity of all CPUs
> +              - cpu
The triggers phy0tx and hci0-power are missed.

Since you've rewritten it, please consider sorting these property strings
in ascending alphabetical order.

> +      - items:
> +            # LED indicates activity of [N]th CPU
> +          - pattern: "^cpu[0-9][0-9]$"
should be ^cpu[0-9]{1,2}$, otherwise, it always requires two digit.

> +      - items:
> +            # LED indicates [N]th MMC storage activity
> +          - pattern: '^mmc[0-9][0-9]$'
should be '^mmc[0-9]{1,2}$'

Why CPU use "", and mmc use '',It's better to keep them consistent.

>  
>    led-pattern:
>      description: |
>
Manivannan Sadhasivam Dec. 10, 2020, 7:26 a.m. UTC | #2
On Thu, Dec 10, 2020 at 02:57:09PM +0800, Leizhen (ThunderTown) wrote:
> 
> 
> On 2020/12/10 14:14, Manivannan Sadhasivam wrote:
> > This commit documents the LED triggers used commonly in the SoCs. Not
> > all triggers are documented as some of them are very application specific.
> > Most of the triggers documented here are currently used in devicetrees
> > of many SoCs.
> > 
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> >  .../devicetree/bindings/leds/common.yaml      | 72 ++++++++++++++-----
> >  1 file changed, 54 insertions(+), 18 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml
> > index f1211e7045f1..eee4eb7a4535 100644
> > --- a/Documentation/devicetree/bindings/leds/common.yaml
> > +++ b/Documentation/devicetree/bindings/leds/common.yaml
> > @@ -79,24 +79,60 @@ properties:
> >        the LED.
> >      $ref: /schemas/types.yaml#definitions/string
> >  
> > -    enum:
> > -        # LED will act as a back-light, controlled by the framebuffer system
> > -      - backlight
> > -        # LED will turn on (but for leds-gpio see "default-state" property in
> > -        # Documentation/devicetree/bindings/leds/leds-gpio.yaml)
> > -      - default-on
> > -        # LED "double" flashes at a load average based rate
> > -      - heartbeat
> > -        # LED indicates disk activity
> > -      - disk-activity
> > -        # LED indicates IDE disk activity (deprecated), in new implementations
> > -        # use "disk-activity"
> > -      - ide-disk
> > -        # LED flashes at a fixed, configurable rate
> > -      - timer
> > -        # LED alters the brightness for the specified duration with one software
> > -        # timer (requires "led-pattern" property)
> > -      - pattern
> > +    oneOf:
> > +      - items:
> > +          - enum:
> > +                # LED will act as a back-light, controlled by the framebuffer system
> > +              - backlight
> > +                # LED will turn on (but for leds-gpio see "default-state" property in
> > +                # Documentation/devicetree/bindings/leds/leds-gpio.yaml)
> > +              - default-on
> > +                # LED "double" flashes at a load average based rate
> > +              - heartbeat
> > +                # LED indicates disk activity
> > +              - disk-activity
> > +                # LED indicates IDE disk activity (deprecated), in new implementations
> > +                # use "disk-activity"
> > +              - ide-disk
> > +                # LED flashes at a fixed, configurable rate
> > +              - timer
> > +                # LED alters the brightness for the specified duration with one software
> > +                # timer (requires "led-pattern" property)
> > +              - pattern
> > +                # LED indicates camera flash state
> > +              - flash
> > +                # LED indicates camera torch state
> > +              - torch
> > +                # LED indicates audio mute state
> > +              - audio-mute
> > +                # LED indicates mic mute state
> > +              - audio-micmute
> > +                # LED indicates bluetooth power state
> > +              - bluetooth-power
> > +                # LED indicates USB gadget activity
> > +              - usb-gadget
> > +                # LED indicates USB host activity
> > +              - usb-host
> > +                # LED indicates MTD memory activity
> > +              - mtd
> > +                # LED indicates NAND memory activity (deprecated),
> > +                # in new implementations use "mtd"
> > +              - nand-disk
> > +                # LED indicates disk read activity
> > +              - disk-read
> > +                # LED indicates disk write activity
> > +              - disk-write
> > +                # No trigger assigned to the LED. This is the default mode
> > +                # if trigger is absent
> > +              - none
> > +                # LED indicates activity of all CPUs
> > +              - cpu
> The triggers phy0tx and hci0-power are missed.
> 

Yes, I just reworked my previous patch. Will add them.

> Since you've rewritten it, please consider sorting these property strings
> in ascending alphabetical order.
> 

Makes sense!

> > +      - items:
> > +            # LED indicates activity of [N]th CPU
> > +          - pattern: "^cpu[0-9][0-9]$"
> should be ^cpu[0-9]{1,2}$, otherwise, it always requires two digit.
>

Aww... Yes. Will fix it.

> > +      - items:
> > +            # LED indicates [N]th MMC storage activity
> > +          - pattern: '^mmc[0-9][0-9]$'
> should be '^mmc[0-9]{1,2}$'
> 
> Why CPU use "", and mmc use '',It's better to keep them consistent.
> 

Sure.

Thanks,
Mani

> >  
> >    led-pattern:
> >      description: |
> > 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml
index f1211e7045f1..eee4eb7a4535 100644
--- a/Documentation/devicetree/bindings/leds/common.yaml
+++ b/Documentation/devicetree/bindings/leds/common.yaml
@@ -79,24 +79,60 @@  properties:
       the LED.
     $ref: /schemas/types.yaml#definitions/string
 
-    enum:
-        # LED will act as a back-light, controlled by the framebuffer system
-      - backlight
-        # LED will turn on (but for leds-gpio see "default-state" property in
-        # Documentation/devicetree/bindings/leds/leds-gpio.yaml)
-      - default-on
-        # LED "double" flashes at a load average based rate
-      - heartbeat
-        # LED indicates disk activity
-      - disk-activity
-        # LED indicates IDE disk activity (deprecated), in new implementations
-        # use "disk-activity"
-      - ide-disk
-        # LED flashes at a fixed, configurable rate
-      - timer
-        # LED alters the brightness for the specified duration with one software
-        # timer (requires "led-pattern" property)
-      - pattern
+    oneOf:
+      - items:
+          - enum:
+                # LED will act as a back-light, controlled by the framebuffer system
+              - backlight
+                # LED will turn on (but for leds-gpio see "default-state" property in
+                # Documentation/devicetree/bindings/leds/leds-gpio.yaml)
+              - default-on
+                # LED "double" flashes at a load average based rate
+              - heartbeat
+                # LED indicates disk activity
+              - disk-activity
+                # LED indicates IDE disk activity (deprecated), in new implementations
+                # use "disk-activity"
+              - ide-disk
+                # LED flashes at a fixed, configurable rate
+              - timer
+                # LED alters the brightness for the specified duration with one software
+                # timer (requires "led-pattern" property)
+              - pattern
+                # LED indicates camera flash state
+              - flash
+                # LED indicates camera torch state
+              - torch
+                # LED indicates audio mute state
+              - audio-mute
+                # LED indicates mic mute state
+              - audio-micmute
+                # LED indicates bluetooth power state
+              - bluetooth-power
+                # LED indicates USB gadget activity
+              - usb-gadget
+                # LED indicates USB host activity
+              - usb-host
+                # LED indicates MTD memory activity
+              - mtd
+                # LED indicates NAND memory activity (deprecated),
+                # in new implementations use "mtd"
+              - nand-disk
+                # LED indicates disk read activity
+              - disk-read
+                # LED indicates disk write activity
+              - disk-write
+                # No trigger assigned to the LED. This is the default mode
+                # if trigger is absent
+              - none
+                # LED indicates activity of all CPUs
+              - cpu
+      - items:
+            # LED indicates activity of [N]th CPU
+          - pattern: "^cpu[0-9][0-9]$"
+      - items:
+            # LED indicates [N]th MMC storage activity
+          - pattern: '^mmc[0-9][0-9]$'
 
   led-pattern:
     description: |