devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 2/3] dt-bindings: leds: Shiji Lighting APA102C LED driver
       [not found] ` <1582018657-5720-3-git-send-email-nbelin@baylibre.com>
@ 2020-02-20 10:30   ` Geert Uytterhoeven
  2020-02-20 19:41     ` Jacek Anaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2020-02-20 10:30 UTC (permalink / raw)
  To: Nicolas Belin
  Cc: Linux Kernel Mailing List, linux-leds, Jacek Anaszewski,
	Pavel Machek, Dan Murphy,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Lukas Wunner

Hi Nicolas,

CC devicetree, Lukas

On Tue, Feb 18, 2020 at 10:39 AM Nicolas Belin <nbelin@baylibre.com> wrote:
> Document Shiji Lighting APA102C LED driver device tree bindings.
>
> Signed-off-by: Nicolas Belin <nbelin@baylibre.com>
> ---
>  .../devicetree/bindings/leds/leds-apa102c.yaml     | 91 ++++++++++++++++++++++
>  1 file changed, 91 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/leds/leds-apa102c.yaml
>
> diff --git a/Documentation/devicetree/bindings/leds/leds-apa102c.yaml b/Documentation/devicetree/bindings/leds/leds-apa102c.yaml
> new file mode 100644
> index 000000000000..24bc2fc19fcb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/leds-apa102c.yaml
> @@ -0,0 +1,91 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/leds-apa102c.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: LED driver for Shiji Lighting - APA102C
> +
> +maintainers:
> +  - Nicolas Belin <nbelin@baylibre.com>
> +
> +description:
> +  Each LED is represented as a sub-node of the leds-apa102c device.  Each LED
> +  is a three color RGB LED with 32 levels brightness adjustment that can be
> +  cascaded so that multiple LEDs can be set with a single command.
> +
> +properties:
> +  compatible:
> +    const: shiji,apa102c
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-max-frequency:
> +    maximum: 1000000
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +required:
> +  - compatible
> +  - reg
> +  - spi-max-frequency
> +  - '#address-cells'
> +  - '#size-cells'
> +
> +patternProperties:
> +  "^led@[0-9]+$":
> +    type: object
> +    description: |
> +      Properties for an array of connected LEDs.
> +
> +    properties:
> +      reg:
> +        description: |
> +          This property corresponds to the led index. It has to be between 0
> +          and the number of managed leds minus 1
> +        maxItems: 1
> +
> +      label:
> +        description: |
> +          This property corresponds to the name of the led. If not set,
> +          the led index will be used to create the led name instead
> +        maxItems: 1
> +
> +      linux,default-trigger: true
> +
> +    required:
> +      - reg
> +
> +examples:
> +  - |
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        led-controller@0 {
> +            compatible = "shiji,apa102c";
> +            reg = <0>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            spi-max-frequency = <1000000>;
> +            led@0 {
> +                reg = <0>;
> +                label = "led1";
> +            };
> +
> +            led@1 {
> +                reg = <1>;
> +                label = "led2";
> +            };
> +
> +            led@2 {
> +                reg = <2>;
> +                label = "led3";
> +            };
> +        };
> +    };

Perhaps this should use "#daisy-chained-devices" instead of listing all LEDs
explicitly?
Or would that cause problems w.r.t. LED labeling?

Documentation/devicetree/bindings/common-properties.txt

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/3] dt-bindings: leds: Shiji Lighting APA102C LED driver
  2020-02-20 10:30   ` [PATCH 2/3] dt-bindings: leds: Shiji Lighting APA102C LED driver Geert Uytterhoeven
@ 2020-02-20 19:41     ` Jacek Anaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Jacek Anaszewski @ 2020-02-20 19:41 UTC (permalink / raw)
  To: Geert Uytterhoeven, Nicolas Belin
  Cc: Linux Kernel Mailing List, linux-leds, Pavel Machek, Dan Murphy,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Lukas Wunner

Hi Geert,

On 2/20/20 11:30 AM, Geert Uytterhoeven wrote:
> Hi Nicolas,
> 
> CC devicetree, Lukas
> 
> On Tue, Feb 18, 2020 at 10:39 AM Nicolas Belin <nbelin@baylibre.com> wrote:
>> Document Shiji Lighting APA102C LED driver device tree bindings.
>>
>> Signed-off-by: Nicolas Belin <nbelin@baylibre.com>
>> ---
>>  .../devicetree/bindings/leds/leds-apa102c.yaml     | 91 ++++++++++++++++++++++
>>  1 file changed, 91 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/leds/leds-apa102c.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/leds/leds-apa102c.yaml b/Documentation/devicetree/bindings/leds/leds-apa102c.yaml
>> new file mode 100644
>> index 000000000000..24bc2fc19fcb
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/leds/leds-apa102c.yaml
>> @@ -0,0 +1,91 @@
>> +# SPDX-License-Identifier: GPL-2.0
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/leds/leds-apa102c.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: LED driver for Shiji Lighting - APA102C
>> +
>> +maintainers:
>> +  - Nicolas Belin <nbelin@baylibre.com>
>> +
>> +description:
>> +  Each LED is represented as a sub-node of the leds-apa102c device.  Each LED
>> +  is a three color RGB LED with 32 levels brightness adjustment that can be
>> +  cascaded so that multiple LEDs can be set with a single command.
>> +
>> +properties:
>> +  compatible:
>> +    const: shiji,apa102c
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  spi-max-frequency:
>> +    maximum: 1000000
>> +
>> +  "#address-cells":
>> +    const: 1
>> +
>> +  "#size-cells":
>> +    const: 0
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +  - spi-max-frequency
>> +  - '#address-cells'
>> +  - '#size-cells'
>> +
>> +patternProperties:
>> +  "^led@[0-9]+$":
>> +    type: object
>> +    description: |
>> +      Properties for an array of connected LEDs.
>> +
>> +    properties:
>> +      reg:
>> +        description: |
>> +          This property corresponds to the led index. It has to be between 0
>> +          and the number of managed leds minus 1
>> +        maxItems: 1
>> +
>> +      label:
>> +        description: |
>> +          This property corresponds to the name of the led. If not set,
>> +          the led index will be used to create the led name instead
>> +        maxItems: 1
>> +
>> +      linux,default-trigger: true
>> +
>> +    required:
>> +      - reg
>> +
>> +examples:
>> +  - |
>> +    spi {
>> +        #address-cells = <1>;
>> +        #size-cells = <0>;
>> +
>> +        led-controller@0 {
>> +            compatible = "shiji,apa102c";
>> +            reg = <0>;
>> +            #address-cells = <1>;
>> +            #size-cells = <0>;
>> +            spi-max-frequency = <1000000>;
>> +            led@0 {
>> +                reg = <0>;
>> +                label = "led1";
>> +            };
>> +
>> +            led@1 {
>> +                reg = <1>;
>> +                label = "led2";
>> +            };
>> +
>> +            led@2 {
>> +                reg = <2>;
>> +                label = "led3";
>> +            };
>> +        };
>> +    };
> 
> Perhaps this should use "#daisy-chained-devices" instead of listing all LEDs
> explicitly?
> Or would that cause problems w.r.t. LED labeling?

It would be against common LED bindings.

Besides, this daisy-chain-devices property is not well documented.
I.e. I don't see how it facilitates conveying information on output
ID (here reg is used for that), and as you already mentioned
- LED labeling.

Generally speaking, I don't think it is applicable to the LED subsystem.

> Documentation/devicetree/bindings/common-properties.txt
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 

-- 
Best regards,
Jacek Anaszewski

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-20 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1582018657-5720-1-git-send-email-nbelin@baylibre.com>
     [not found] ` <1582018657-5720-3-git-send-email-nbelin@baylibre.com>
2020-02-20 10:30   ` [PATCH 2/3] dt-bindings: leds: Shiji Lighting APA102C LED driver Geert Uytterhoeven
2020-02-20 19:41     ` Jacek Anaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).