* [PATCH v3 leds-next 2/2] dt-bindings: leds: Document Turris Omnia LED controller binding [not found] <20190328193428.19273-1-marek.behun@nic.cz> @ 2019-03-28 19:34 ` Marek Behún 2019-03-29 19:00 ` Marek Behun 2019-04-19 18:10 ` Pavel Machek 0 siblings, 2 replies; 4+ messages in thread From: Marek Behún @ 2019-03-28 19:34 UTC (permalink / raw) To: linux-leds Cc: Pavel Machek, Jacek Anaszewski, Marek Behún, Rob Herring, devicetree This adds device tree binding documentation for the front panel LEDs controller of CZ.NIC's Turris Omnia router. Signed-off-by: Marek Behún <marek.behun@nic.cz> Cc: Rob Herring <robh+dt@kernel.org> Cc: devicetree@vger.kernel.org --- .../bindings/leds/leds-turris-omnia.txt | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-turris-omnia.txt diff --git a/Documentation/devicetree/bindings/leds/leds-turris-omnia.txt b/Documentation/devicetree/bindings/leds/leds-turris-omnia.txt new file mode 100644 index 000000000000..a9fd9a768251 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-turris-omnia.txt @@ -0,0 +1,85 @@ +Bindings for LEDs on CZ.NIC's Turris Omnia + +Required properties: + - compatible : Should be "cznic,turris-omnia-leds" + - reg : I2C slave address + - #address-cells : Should be 1 + - #size-cells : Should be 0 + +LED sub-node properties: + - reg : Must be from 0x0 to 0xb, since there are 12 LEDs on this + controller. + - label : (optional) + see Documentation/devicetree/bindings/leds/common.txt + - linux,default-trigger : (optional) + see Documentation/devicetree/bindings/leds/common.txt + +Example: + + led-controller@2b { + compatible = "cznic,turris-omnia-leds"; + reg = <0x2b>; + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0x0>; + label = "userB"; + linux,default-trigger = "heartbeat"; + }; + + led@1 { + reg = <0x1>; + label = "userA"; + }; + + led@2 { + reg = <0x2>; + label = "pci3"; + }; + + led@3 { + reg = <0x3>; + label = "pci2"; + }; + + led@4 { + reg = <0x4>; + label = "pci1"; + }; + + led@5 { + reg = <0x5>; + label = "wan"; + }; + + led@6 { + reg = <0x6>; + label = "lan4"; + }; + + led@7 { + reg = <0x7>; + label = "lan3"; + }; + + led@8 { + reg = <0x8>; + label = "lan2"; + }; + + led@9 { + reg = <0x9>; + label = "lan1"; + }; + + led@a { + reg = <0xa>; + label = "lan0"; + }; + + led@b { + reg = <0xb>; + label = "power"; + }; + }; -- 2.19.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 leds-next 2/2] dt-bindings: leds: Document Turris Omnia LED controller binding 2019-03-28 19:34 ` [PATCH v3 leds-next 2/2] dt-bindings: leds: Document Turris Omnia LED controller binding Marek Behún @ 2019-03-29 19:00 ` Marek Behun 2019-03-29 20:40 ` Pavel Machek 2019-04-19 18:10 ` Pavel Machek 1 sibling, 1 reply; 4+ messages in thread From: Marek Behun @ 2019-03-29 19:00 UTC (permalink / raw) To: Rob Herring; +Cc: linux-leds, Pavel Machek, Jacek Anaszewski, devicetree Hi Rob, I have a question about how to design correctly the situation about global brigthness on this controller in the device tree. The thing is that these LEDs are, in hardware, controlled via PWM and SPI, but this is done via microcontroller running a proprietary firmware. So from the point of view of the CPU, should the LEDs be described in the device tree as connected to the mircocontroller direclty, or should pwm and spi nodes be created as well? Next thing is that the values of the RGB channels for each LED is controlled via SPI, but the global brightness controlled byt the single PWM also controls the LED brightnesses globally. How should this be specified? Thank you. > +Example: > + > + led-controller@2b { > + compatible = "cznic,turris-omnia-leds"; > + reg = <0x2b>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + led@0 { > + reg = <0x0>; > + label = "userB"; > + linux,default-trigger = "heartbeat"; > + }; > + > + led@1 { > + reg = <0x1>; > + label = "userA"; > + }; > + > + led@2 { > + reg = <0x2>; > + label = "pci3"; > + }; > + > + led@3 { > + reg = <0x3>; > + label = "pci2"; > + }; > + > + led@4 { > + reg = <0x4>; > + label = "pci1"; > + }; > + > + led@5 { > + reg = <0x5>; > + label = "wan"; > + }; > + > + led@6 { > + reg = <0x6>; > + label = "lan4"; > + }; > + > + led@7 { > + reg = <0x7>; > + label = "lan3"; > + }; > + > + led@8 { > + reg = <0x8>; > + label = "lan2"; > + }; > + > + led@9 { > + reg = <0x9>; > + label = "lan1"; > + }; > + > + led@a { > + reg = <0xa>; > + label = "lan0"; > + }; > + > + led@b { > + reg = <0xb>; > + label = "power"; > + }; > + }; ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 leds-next 2/2] dt-bindings: leds: Document Turris Omnia LED controller binding 2019-03-29 19:00 ` Marek Behun @ 2019-03-29 20:40 ` Pavel Machek 0 siblings, 0 replies; 4+ messages in thread From: Pavel Machek @ 2019-03-29 20:40 UTC (permalink / raw) To: Marek Behun; +Cc: Rob Herring, linux-leds, Jacek Anaszewski, devicetree [-- Attachment #1: Type: text/plain, Size: 2570 bytes --] Hi! > I have a question about how to design correctly the situation about > global brigthness on this controller in the device tree. > > The thing is that these LEDs are, in hardware, controlled via PWM and > SPI, but this is done via microcontroller running a proprietary > firmware. So from the point of view of the CPU, should the LEDs be > described in the device tree as connected to the mircocontroller > direclty, or should pwm and spi nodes be created as well? I don't think you need to describe interfaces between > Next thing is that the values of the RGB channels for each LED is > controlled via SPI, but the global brightness controlled byt the single > PWM also controls the LED brightnesses globally. > > How should this be specified? I'd say it does not need to be specified in the device tree. Device tree tells us about the microcontroller, and driver knows the rest. This is not generic hardware, this is microcontroller with special programming. Strictly speaking, we'd need to know about the LEDs, either; cznic,turris-omnia-leds means we have 12 LEDs and what they mean. But let's keep the LEDs, it will be easier that way. Pave IOW: this is okay: > > +Example: > > + > > + led-controller@2b { > > + compatible = "cznic,turris-omnia-leds"; > > + reg = <0x2b>; > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + led@0 { > > + reg = <0x0>; > > + label = "userB"; > > + linux,default-trigger = "heartbeat"; > > + }; > > + > > + led@1 { > > + reg = <0x1>; > > + label = "userA"; > > + }; > > + > > + led@2 { > > + reg = <0x2>; > > + label = "pci3"; > > + }; > > + > > + led@3 { > > + reg = <0x3>; > > + label = "pci2"; > > + }; > > + > > + led@4 { > > + reg = <0x4>; > > + label = "pci1"; > > + }; > > + > > + led@5 { > > + reg = <0x5>; > > + label = "wan"; > > + }; > > + > > + led@6 { > > + reg = <0x6>; > > + label = "lan4"; > > + }; > > + > > + led@7 { > > + reg = <0x7>; > > + label = "lan3"; > > + }; > > + > > + led@8 { > > + reg = <0x8>; > > + label = "lan2"; > > + }; > > + > > + led@9 { > > + reg = <0x9>; > > + label = "lan1"; > > + }; > > + > > + led@a { > > + reg = <0xa>; > > + label = "lan0"; > > + }; > > + > > + led@b { > > + reg = <0xb>; > > + label = "power"; > > + }; > > + }; -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 181 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 leds-next 2/2] dt-bindings: leds: Document Turris Omnia LED controller binding 2019-03-28 19:34 ` [PATCH v3 leds-next 2/2] dt-bindings: leds: Document Turris Omnia LED controller binding Marek Behún 2019-03-29 19:00 ` Marek Behun @ 2019-04-19 18:10 ` Pavel Machek 1 sibling, 0 replies; 4+ messages in thread From: Pavel Machek @ 2019-04-19 18:10 UTC (permalink / raw) To: Marek Behún; +Cc: linux-leds, Jacek Anaszewski, Rob Herring, devicetree [-- Attachment #1: Type: text/plain, Size: 478 bytes --] On Thu 2019-03-28 20:34:28, Marek Behún wrote: > This adds device tree binding documentation for the front panel LEDs > controller of CZ.NIC's Turris Omnia router. > > Signed-off-by: Marek Behún <marek.behun@nic.cz> > Cc: Rob Herring <robh+dt@kernel.org> > Cc: devicetree@vger.kernel.org Acked-by: Pavel Machek <pavel@ucw.cz> -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 181 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-04-19 18:10 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20190328193428.19273-1-marek.behun@nic.cz> 2019-03-28 19:34 ` [PATCH v3 leds-next 2/2] dt-bindings: leds: Document Turris Omnia LED controller binding Marek Behún 2019-03-29 19:00 ` Marek Behun 2019-03-29 20:40 ` Pavel Machek 2019-04-19 18:10 ` Pavel Machek
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.