diff mbox series

[v2,4/5] dt-bindings: leds: Add pattern initialization from Device Tree

Message ID 1544434201-14190-5-git-send-email-krzk@kernel.org
State Superseded, archived
Headers show
Series leds: trigger: Add pattern initialization from Device Tree | expand

Checks

Context Check Description
robh/checkpatch success

Commit Message

Krzysztof Kozlowski Dec. 10, 2018, 9:30 a.m. UTC
Document new linux,trigger-pattern property for initialization of LED
pattern trigger.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 Documentation/devicetree/bindings/leds/common.txt | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Rob Herring (Arm) Dec. 11, 2018, 5:23 p.m. UTC | #1
On Mon, Dec 10, 2018 at 3:30 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> Document new linux,trigger-pattern property for initialization of LED
> pattern trigger.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  Documentation/devicetree/bindings/leds/common.txt | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/leds/common.txt b/Documentation/devicetree/bindings/leds/common.txt
> index aa1399814a2a..4c65e854bb91 100644
> --- a/Documentation/devicetree/bindings/leds/common.txt
> +++ b/Documentation/devicetree/bindings/leds/common.txt
> @@ -37,6 +37,13 @@ Optional properties for child nodes:
>       "ide-disk" - LED indicates IDE disk activity (deprecated),
>                    in new implementations use "disk-activity"
>       "timer" - LED flashes at a fixed, configurable rate
> +     "pattern" - LED alters the brightness for the specified duration with one
> +                 software timer (see
> +                 Documentation/ABI/testing/sysfs-class-led-trigger-pattern)
> +
> +- linux,trigger-pattern : Default pattern for "pattern" trigger (see
> +                          Documentation/ABI/testing/sysfs-class-led-trigger-pattern
> +                          for description of format)

Binding documents should generally not refer to kernel docs and need
to stand on their own.

I don't think this needs to be linux specific. I'd just call it
'led-pattern'. I don't think this should be tied to the trigger types.
Isn't possible you would want to tie a pattern to different triggers.
IOW, when event X happens, run the pattern. And you could have
one-shot versus continuous.

Rob
Krzysztof Kozlowski Dec. 12, 2018, 8:42 a.m. UTC | #2
On Tue, 11 Dec 2018 at 18:23, Rob Herring <robh@kernel.org> wrote:
>
> On Mon, Dec 10, 2018 at 3:30 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >
> > Document new linux,trigger-pattern property for initialization of LED
> > pattern trigger.
> >
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > ---
> >  Documentation/devicetree/bindings/leds/common.txt | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/leds/common.txt b/Documentation/devicetree/bindings/leds/common.txt
> > index aa1399814a2a..4c65e854bb91 100644
> > --- a/Documentation/devicetree/bindings/leds/common.txt
> > +++ b/Documentation/devicetree/bindings/leds/common.txt
> > @@ -37,6 +37,13 @@ Optional properties for child nodes:
> >       "ide-disk" - LED indicates IDE disk activity (deprecated),
> >                    in new implementations use "disk-activity"
> >       "timer" - LED flashes at a fixed, configurable rate
> > +     "pattern" - LED alters the brightness for the specified duration with one
> > +                 software timer (see
> > +                 Documentation/ABI/testing/sysfs-class-led-trigger-pattern)
> > +
> > +- linux,trigger-pattern : Default pattern for "pattern" trigger (see
> > +                          Documentation/ABI/testing/sysfs-class-led-trigger-pattern
> > +                          for description of format)
>
> Binding documents should generally not refer to kernel docs and need
> to stand on their own.

I'll copy then the description of pattern.

> I don't think this needs to be linux specific. I'd just call it
> 'led-pattern'. I don't think this should be tied to the trigger types.
> Isn't possible you would want to tie a pattern to different triggers.
> IOW, when event X happens, run the pattern. And you could have
> one-shot versus continuous.

In general pattern has trigger specific format. For pattern-trigger it
would look like "0 1000 255 1000". For timer trigger it would be just
a single number (period for blinks). Quite similar for the oneshot
trigger. I can change it to "led-pattern" (or maybe
"led-default-pattern" to match "linux,default-trigger" property?) and
document that the pattern itself is trigger specific

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/leds/common.txt b/Documentation/devicetree/bindings/leds/common.txt
index aa1399814a2a..4c65e854bb91 100644
--- a/Documentation/devicetree/bindings/leds/common.txt
+++ b/Documentation/devicetree/bindings/leds/common.txt
@@ -37,6 +37,13 @@  Optional properties for child nodes:
      "ide-disk" - LED indicates IDE disk activity (deprecated),
                   in new implementations use "disk-activity"
      "timer" - LED flashes at a fixed, configurable rate
+     "pattern" - LED alters the brightness for the specified duration with one
+                 software timer (see
+                 Documentation/ABI/testing/sysfs-class-led-trigger-pattern)
+
+- linux,trigger-pattern : Default pattern for "pattern" trigger (see
+                          Documentation/ABI/testing/sysfs-class-led-trigger-pattern
+                          for description of format)
 
 - led-max-microamp : Maximum LED supply current in microamperes. This property
                      can be made mandatory for the board configurations