Re: [PATCH v2 4/5] dt-bindings: leds: Add pattern initialization from Device Tree
From: Krzysztof Kozlowski
Date: Wed Dec 12 2018 - 03:42:47 EST
On Tue, 11 Dec 2018 at 18:23, Rob Herring <robh@xxxxxxxxxx> wrote:
>
> On Mon, Dec 10, 2018 at 3:30 AM Krzysztof Kozlowski <krzk@xxxxxxxxxx> wrote:
> >
> > Document new linux,trigger-pattern property for initialization of LED
> > pattern trigger.
> >
> > Signed-off-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
> > ---
> > 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