[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJsYDV+hZFVej2fk41TphgAbv+zsRKG+KOLjJJCJ9eiuGrOLhw@mail.gmail.com>
Date: Sat, 3 Dec 2022 21:46:01 +0800
From: Chuanhong Guo <gch981213@...il.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: linux-leds@...r.kernel.org, Pavel Machek <pavel@....cz>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Stanislav Jakubek <stano.jakubek@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Shawn Guo <shawnguo@...nel.org>,
Johan Hovold <johan+linaro@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Marijn Suijten <marijn.suijten@...ainline.org>,
Sven Schwermer <sven.schwermer@...ruptive-technologies.com>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/3] dt-bindings: leds: add dt schema for worldsemi,ws2812b-spi
On Sat, Dec 3, 2022 at 8:25 PM Krzysztof Kozlowski
<krzysztof.kozlowski@...aro.org> wrote:
> >>>>> + maxItems: 3
> >>>>> + items:
> >>>>> + minimum: 0
> >>>>> + maximum: 255
> >>>>> +
> >>>>> + reg:
> >>>>> + description: |
> >>>>> + Which LED this node represents. The reg of the first LED on the chain
> >>>>> + is 0.
> >>>>> + maxItems: 1
> >>>>> +
> >>>>> + required:
> >>>>> + - reg
> >>>>> + - color
> >>>>> + - function
> >>>>> +
> >>>>> +required:
> >>>>> + - compatible
> >>>>> +
> >>>>> +additionalProperties: false
> >>>>> +
> >>>>> +examples:
> >>>>> + - |
> >>>>> + #include <dt-bindings/leds/common.h>
> >>>>> + spi {
> >>>>> + #address-cells = <1>;
> >>>>> + #size-cells = <0>;
> >>>>> +
> >>>>> + leds@0 {
> >>>>
> >>>> git grep leds@ -- Documentation/devicetree/ | wc -l
> >>>> 1
> >>>> git grep led@ -- Documentation/devicetree/ | wc -l
> >>>> 165
> >>>>
> >>>> so rather not the first one ("leds").
> >>>
> >>> As you can see, this node describes a chain of LEDs, not
> >>> a single LED, so the plural form is more appropriate than
> >>> the singular form.
> >>>
> >>>>
> >>>> There is also:
> >>>> git grep led-controller@ -- Documentation/devicetree/ | wc -l
> >>>> 30
> >>>
> >>> This also isn't appropriate. WS2812B is a single LED package
> >>> of 3 diodes and a microcontroller. If we treat every package
> >>> as a LED, the SPI MOSI is connected directly to the LED
> >>> packages themselves with no controller in between.
> >>> If we treat the microcontroller as a led-controller, every
> >>> LED contains its own controller, instead of one controller
> >>> controlling all LEDs, and the parent node still shouldn't
> >>> be called a led-controller.
> >>>
> >>> Here's a picture of the WS2812B LED package:
> >>> https://cdn-shop.adafruit.com/970x728/1655-00.jpg
> >>> and a chain of them:
> >>> https://cdn-shop.adafruit.com/970x728/1463-00.jpg
> >>
> >> Then your bindings and DTS do not represent the hardware.
> >
> > How should this hardware be represented, then?
> >
> > The connection can be:
> >
> > SPI-MOSI---LED1---LED2---LED3---...---LEDN
> >
> > or
> >
> > SPI-MOSI---Tri-state signal gate---LED1---LED2---LED3---...---LEDN
> > SPI-CS-----|
>
> I would look at it this as either of:
> 1. serially linked separate LED controllers (so multiple device nodes)
>
> 2. one LED controller handling the entire LED system of many
> sub-controllers.
>
> For the (2) I proposed the name led-controller. If you think this is not
> (2), then looks like (1) and you should have many devices... which
> probably is not doable on itself. And how to call this entire set of
> separate LED controllers? Heh, can be also some controller, like
> led-controller.
OK. I'll name it led-controller in the next version.
--
Regards,
Chuanhong Guo
Powered by blists - more mailing lists