Message ID | 1570334746.101942.1600803234657@mail.vodafone.de |
---|---|
State | New |
Headers | show |
Series | [v1,1/2] leds: pca9532: read pwm settings from device tree | expand |
On Tue, Sep 22, 2020 at 09:33:54PM +0200, Markus Moll wrote: > These properties allow users to configure the PCA9532 blink rates. > > Signed-off-by: Markus Moll <mmoll@de.pepperl-fuchs.com> > --- > .../devicetree/bindings/leds/leds-pca9532.txt | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/Documentation/devicetree/bindings/leds/leds-pca9532.txt b/Documentation/devicetree/bindings/leds/leds-pca9532.txt > index f769c52e364..3aa05eca9df 100644 > --- a/Documentation/devicetree/bindings/leds/leds-pca9532.txt > +++ b/Documentation/devicetree/bindings/leds/leds-pca9532.txt > @@ -11,6 +11,14 @@ Required properties: > "nxp,pca9533" > - reg - I2C slave address > > +Optional properties: > + - nxp,pwm: array of two 8-bit values specifying the blink duty cycle > + fractions of each pwm (default <0 0>) > + The duty cycle is pwm/256. > + - nxp,psc: array of two 8-bit values specifying the blink period of > + each pwm (default <0 0>) > + The period is (psc+1)/152 seconds. I believe we have standard properties for LED patterns now. > + > Each led is represented as a sub-node of the nxp,pca9530. > > Optional sub-node properties: > @@ -26,6 +34,8 @@ Example: > leds: pca9530@60 { > compatible = "nxp,pca9530"; > reg = <0x60>; > + nxp,pwm = /bits/ 8 <128 128>; // 50% duty cycle > + nxp,psc = /bits/ 8 <151 37>; // 1Hz and 4Hz, respectively > > red-power { > label = "pca:red:power"; > -- > 2.25.1
Am Dienstag, 29. September 2020, 20:14:09 CEST schrieb Rob Herring: > > I believe we have standard properties for LED patterns now. > Oh... I guess I had completely misunderstood how the timer trigger works. It's quite possible that the timer trigger + the led-pattern property will solve all of the problems I originally had and thus eliminate the need for my device-tree patches. Markus
diff --git a/Documentation/devicetree/bindings/leds/leds-pca9532.txt b/Documentation/devicetree/bindings/leds/leds-pca9532.txt index f769c52e364..3aa05eca9df 100644 --- a/Documentation/devicetree/bindings/leds/leds-pca9532.txt +++ b/Documentation/devicetree/bindings/leds/leds-pca9532.txt @@ -11,6 +11,14 @@ Required properties: "nxp,pca9533" - reg - I2C slave address +Optional properties: + - nxp,pwm: array of two 8-bit values specifying the blink duty cycle + fractions of each pwm (default <0 0>) + The duty cycle is pwm/256. + - nxp,psc: array of two 8-bit values specifying the blink period of + each pwm (default <0 0>) + The period is (psc+1)/152 seconds. + Each led is represented as a sub-node of the nxp,pca9530. Optional sub-node properties: @@ -26,6 +34,8 @@ Example: leds: pca9530@60 { compatible = "nxp,pca9530"; reg = <0x60>; + nxp,pwm = /bits/ 8 <128 128>; // 50% duty cycle + nxp,psc = /bits/ 8 <151 37>; // 1Hz and 4Hz, respectively red-power { label = "pca:red:power";
These properties allow users to configure the PCA9532 blink rates. Signed-off-by: Markus Moll <mmoll@de.pepperl-fuchs.com> --- .../devicetree/bindings/leds/leds-pca9532.txt | 10 ++++++++++ 1 file changed, 10 insertions(+)