mbox series

[v7,00/12] leds: pwm: Make automatic labels work

Message ID 20201005203451.9985-1-post@lespocky.de
Headers show
Series leds: pwm: Make automatic labels work | expand

Message

Alexander Dahl Oct. 5, 2020, 8:34 p.m. UTC
Hei hei,

for leds-gpio you can use the properties 'function' and 'color' in the
devicetree node and omit 'label', the label is constructed
automatically.  This is a common feature supposed to be working for all
LED drivers.  However it did not work until recently for the 'leds-pwm'
driver.

This series removes the no more needed platform_data support from the
leds-pwm driver, which was a precondition for the already applied patch
actually making automatic naming work.

The leds-pwm dt-bindings are converted and updated to reflect the
possibility to use led function and color for naming now.

v7 of this series is basically collecting reviewed-by tags, split old
patch 5/7 into per arm sub-arch changes for easier maintainer review,
and rewording commit messages.  See each patch for a detailed changelog.

For the bindings conversion it's now required to explicitly set a
license.  Peter, Russel, could you please acknowledge that patch?

Series changelog below …

Greets
Alex

v7:
- rebased series on recent pavel/for-next
- split up arm dts patch by arm sub arch (suggested by Krzysztof Kozlowski)
- added multiple Reviewed-by tags
- slightly reworded commit messages (suggested by Krzysztof Kozlowski)
- added actual dtbs_check warnings to commit messages
- added Russell King to Cc for binding conversion patch (because license)

v6:
- rebased series on recent pavel/for-next
- added Reviewed-by from Marek to patch 1
- patch 2 from v5 was picked by Pavel and is already in his for-next
  branch
- previous patch 3/3 (now 2/7) was reworked based on feedback by Rob
- added more dt patches fixing warnings after binding conversion to yaml

v5:
- replaced patch 1/3 by a new patch removing platform_data support for
  the leds-pwm driver
- little rewording of commit message in patch 2/3
- updated patch 3/3 based on feedback by Rob Herring
- added Marek Behún to Cc, because he also works on removing
  platform_data support
- rebased series on pavel/for-next

v4:
- added led-class patch handling fwnode passing differently (patch 1/3)
- adapted leds-pwm patch to new led-class (patch 2/3)
- contacted original author of leds-pwm dt binding on license issue
  (patch 3/3)

v3:
- series rebased on v5.9-rc4
- changed license of .yaml file to recommended one (patch 2/2)
- added Acked-by to both patches

v2:
- series rebased on v5.9-rc3
- added the dt-bindings update patch (2/2)

v1:
- based on v5.9-rc2
- backport on v5.4.59 tested and working

Cc: linux-leds@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-amlogic@lists.infradead.org
Cc: linux-mips@vger.kernel.org

Alexander Dahl (12):
  leds: pwm: Remove platform_data support
  dt-bindings: leds: Convert pwm to yaml
  dt-bindings: mfd: Fix schema warnings for pwm-leds
  ARM: dts: at91: smartkiz: Reference led node directly
  ARM: dts: at91: Fix schema warnings for pwm-leds
  ARM: dts: berlin: Fix schema warnings for pwm-leds
  ARM: dts: exynos: Fix schema warnings for pwm-leds
  ARM: dts: imx: Fix schema warnings for pwm-leds
  ARM: dts: omap: Fix schema warnings for pwm-leds
  ARM: dts: stm32: Fix schema warnings for pwm-leds
  arm64: dts: meson: Fix schema warnings for pwm-leds
  MIPS: DTS: img: Fix schema warnings for pwm-leds

 .../devicetree/bindings/leds/leds-pwm.txt     | 50 -------------
 .../devicetree/bindings/leds/leds-pwm.yaml    | 70 +++++++++++++++++++
 .../devicetree/bindings/mfd/iqs62x.yaml       |  5 +-
 arch/arm/boot/dts/at91-kizbox.dts             | 10 +--
 arch/arm/boot/dts/at91-kizbox2-common.dtsi    |  8 +--
 arch/arm/boot/dts/at91-kizbox3-hs.dts         | 16 ++---
 arch/arm/boot/dts/at91-kizbox3_common.dtsi    | 10 +--
 arch/arm/boot/dts/at91-kizboxmini-common.dtsi |  8 +--
 arch/arm/boot/dts/at91-smartkiz.dts           |  6 +-
 arch/arm/boot/dts/at91sam9m10g45ek.dts        | 10 +--
 arch/arm/boot/dts/at91sam9rlek.dts            | 10 +--
 .../boot/dts/berlin2cd-google-chromecast.dts  |  6 +-
 arch/arm/boot/dts/exynos5422-odroidhc1.dts    |  4 +-
 arch/arm/boot/dts/exynos5422-odroidxu4.dts    |  4 +-
 .../boot/dts/exynos54xx-odroidxu-leds.dtsi    | 11 +--
 arch/arm/boot/dts/imx53-ppd.dts               | 15 ++--
 arch/arm/boot/dts/imx6qdl-cubox-i.dtsi        |  4 +-
 .../boot/dts/imx6sx-softing-vining-2000.dts   |  8 +--
 arch/arm/boot/dts/omap3-beagle-xm.dts         | 10 +--
 arch/arm/boot/dts/omap3-overo-base.dtsi       |  4 +-
 arch/arm/boot/dts/omap4-kc1.dts               |  6 +-
 arch/arm/boot/dts/omap4-sdp.dts               | 26 +++----
 arch/arm/boot/dts/stm32mp157c-lxa-mc1.dts     | 12 ++--
 .../amlogic/meson-gxl-s905x-khadas-vim.dts    |  4 +-
 .../dts/amlogic/meson-gxm-khadas-vim2.dts     |  4 +-
 .../boot/dts/amlogic/meson-sm1-sei610.dts     |  8 +--
 arch/mips/boot/dts/img/pistachio_marduk.dts   |  5 +-
 drivers/leds/leds-pwm.c                       | 30 ++------
 28 files changed, 184 insertions(+), 180 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.txt
 create mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.yaml


base-commit: 4f69e17c87e90f9508f498fa4771a9b77db1174b

Comments

Jeff LaBundy Oct. 6, 2020, 2:17 a.m. UTC | #1
Hi Alexander,

On Mon, Oct 05, 2020 at 10:34:42PM +0200, Alexander Dahl wrote:
> The node names for devices using the pwm-leds driver follow a certain
> naming scheme (now).  Parent node name is not enforced, but recommended
> by DT project.
> 
>   DTC     Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml
>   CHECK   Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml
> /home/alex/build/linux/Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml: pwmleds: 'panel' does not match any of the regexes: '^led(-[0-9a-f]+)?$', 'pinctrl-[0-9]+'
>         From schema: /home/alex/src/linux/leds/Documentation/devicetree/bindings/leds/leds-pwm.yaml
> 
> Signed-off-by: Alexander Dahl <post@lespocky.de>
> ---
> 
> Notes:
>     v6 -> v7:
>       * added warning message to commit message (Krzysztof Kozlowski)
>     
>     v6:
>       * added this patch to series
> 
>  Documentation/devicetree/bindings/mfd/iqs62x.yaml | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/iqs62x.yaml b/Documentation/devicetree/bindings/mfd/iqs62x.yaml
> index 541b06d80e73..92dc48a8dfa7 100644
> --- a/Documentation/devicetree/bindings/mfd/iqs62x.yaml
> +++ b/Documentation/devicetree/bindings/mfd/iqs62x.yaml
> @@ -90,10 +90,11 @@ examples:
>              };
>      };
>  
> -    pwmleds {
> +    led-controller {
>              compatible = "pwm-leds";
>  
> -            panel {
> +            led-1 {
> +                    label = "panel";
>                      pwms = <&iqs620a_pwm 0 1000000>;
>                      max-brightness = <255>;
>              };
> -- 
> 2.20.1
> 

I like the consistency this brings. My only feedback is that in the other
examples I found (common.yaml and leds-gpio.yaml), the children count off
from 0 (e.g. led-0) instead of 1 as your series appears to.

That's not a huge deal; it simply seems more consistent to count from the
first index allowed by the regex (0). The patch is still fine, and so:

Acked-by: Jeff LaBundy <jeff@labundy.com>

Kind regards,
Jeff LaBundy
Rob Herring (Arm) Oct. 6, 2020, 10:28 p.m. UTC | #2
On Mon, 05 Oct 2020 22:34:42 +0200, Alexander Dahl wrote:
> The node names for devices using the pwm-leds driver follow a certain
> naming scheme (now).  Parent node name is not enforced, but recommended
> by DT project.
> 
>   DTC     Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml
>   CHECK   Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml
> /home/alex/build/linux/Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml: pwmleds: 'panel' does not match any of the regexes: '^led(-[0-9a-f]+)?$', 'pinctrl-[0-9]+'
>         From schema: /home/alex/src/linux/leds/Documentation/devicetree/bindings/leds/leds-pwm.yaml
> 
> Signed-off-by: Alexander Dahl <post@lespocky.de>
> ---
> 
> Notes:
>     v6 -> v7:
>       * added warning message to commit message (Krzysztof Kozlowski)
> 
>     v6:
>       * added this patch to series
> 
>  Documentation/devicetree/bindings/mfd/iqs62x.yaml | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>
Pavel Machek Oct. 7, 2020, 10:02 a.m. UTC | #3
On Mon 2020-10-05 22:34:41, Alexander Dahl wrote:
> The example was adapted in the following ways:
> 
> - make use of the now supported 'function' and 'color' properties
> - remove pwm nodes, those are documented elsewhere
> - align node names to new dt schema rules and dt recommendations
> 
> License was not explicitly set before.  The license set now is
> recommended by DT project.
> 
> Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> Signed-off-by: Alexander Dahl <post@lespocky.de>
> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Cc: Russell King <linux@armlinux.org.uk>
> ---
> 
> Notes:
>     NOTE: Due to license set/change this needs Acked-by or Signed-off-by from:
>       * Peter Ujfalusi
>       * Russell King

Russell King authored two lines of the documentation. He can state
objections now, but I'll not wait for his Acked-by.

>     That was discussed already with Peter (original author), still waiting
>     for Acked-by though …

If Peter was okay with license change, I guess we can continue here.

Best regards,
									Pavel
Krzysztof Kozlowski Oct. 7, 2020, 10:03 a.m. UTC | #4
On Wed, 7 Oct 2020 at 12:02, Pavel Machek <pavel@ucw.cz> wrote:
>
> On Mon 2020-10-05 22:34:41, Alexander Dahl wrote:
> > The example was adapted in the following ways:
> >
> > - make use of the now supported 'function' and 'color' properties
> > - remove pwm nodes, those are documented elsewhere
> > - align node names to new dt schema rules and dt recommendations
> >
> > License was not explicitly set before.  The license set now is
> > recommended by DT project.
> >
> > Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> > Signed-off-by: Alexander Dahl <post@lespocky.de>
> > Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> > Cc: Russell King <linux@armlinux.org.uk>
> > ---
> >
> > Notes:
> >     NOTE: Due to license set/change this needs Acked-by or Signed-off-by from:
> >       * Peter Ujfalusi
> >       * Russell King
>
> Russell King authored two lines of the documentation. He can state
> objections now, but I'll not wait for his Acked-by.
>
> >     That was discussed already with Peter (original author), still waiting
> >     for Acked-by though …
>
> If Peter was okay with license change, I guess we can continue here.

Having an Ack is not too much to ask to relicense the copyrights.

Best regards,
Krzysztof
Alexander Dahl Oct. 7, 2020, 10:08 a.m. UTC | #5
Hei Pavel,

Am Mittwoch, 7. Oktober 2020, 12:03:59 CEST schrieb Pavel Machek:
> > The node names for devices using the pwm-leds driver follow a certain
> > naming scheme (now).  Parent node name is not enforced, but recommended
> > by DT project.
> > 
> >   DTC     Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml
> >   CHECK   Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml
> > 
> > /home/alex/build/linux/Documentation/devicetree/bindings/mfd/iqs62x.exampl
> > e.dt.yaml: pwmleds: 'panel' does not match any of the regexes:
> > '^led(-[0-9a-f]+)?$', 'pinctrl-[0-9]+'> 
> >         From schema:
> >         /home/alex/src/linux/leds/Documentation/devicetree/bindings/leds/
> >         leds-pwm.yaml> 
> > Signed-off-by: Alexander Dahl <post@lespocky.de>
> 
> Okay, so I need Rob's ack here, I guess... and rest of the series is
> not really for my tree.

I think so, too.

I saw you applied patch number 1, all the other patches are DT and from my 
side those can wait for the Acks required and maybe I change the indexes again 
and I'm fine resending all that after the 5.10 merge window.

Thanks for applying the non-DT patches for leds subsystem, the rest will be 
sorted out without hurry.

Greets
Alex
Lee Jones Oct. 8, 2020, 7:33 a.m. UTC | #6
On Wed, 07 Oct 2020, Pavel Machek wrote:

> Hi!
> 
> > The node names for devices using the pwm-leds driver follow a certain
> > naming scheme (now).  Parent node name is not enforced, but recommended
> > by DT project.
> > 
> >   DTC     Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml
> >   CHECK   Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml
> > /home/alex/build/linux/Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml: pwmleds: 'panel' does not match any of the regexes: '^led(-[0-9a-f]+)?$', 'pinctrl-[0-9]+'
> >         From schema: /home/alex/src/linux/leds/Documentation/devicetree/bindings/leds/leds-pwm.yaml
> > 
> > Signed-off-by: Alexander Dahl <post@lespocky.de>
> 
> Okay, so I need Rob's ack here, I guess... and rest of the series is
> not really for my tree.

This patch is not for your tree either. ;)
Pavel Machek Oct. 8, 2020, 7:50 a.m. UTC | #7
Hi!

> > > The node names for devices using the pwm-leds driver follow a certain
> > > naming scheme (now).  Parent node name is not enforced, but recommended
> > > by DT project.
> > > 
> > >   DTC     Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml
> > >   CHECK   Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml
> > > /home/alex/build/linux/Documentation/devicetree/bindings/mfd/iqs62x.example.dt.yaml: pwmleds: 'panel' does not match any of the regexes: '^led(-[0-9a-f]+)?$', 'pinctrl-[0-9]+'
> > >         From schema: /home/alex/src/linux/leds/Documentation/devicetree/bindings/leds/leds-pwm.yaml
> > > 
> > > Signed-off-by: Alexander Dahl <post@lespocky.de>
> > 
> > Okay, so I need Rob's ack here, I guess... and rest of the series is
> > not really for my tree.
> 
> This patch is not for your tree either. ;)

Ah, right. Usually we have one patch series for one maintainer...

Best regards,
									Pavel
Alexandre Belloni Oct. 28, 2020, 6:56 p.m. UTC | #8
On Mon, 5 Oct 2020 22:34:39 +0200, Alexander Dahl wrote:
> Hei hei,

> 

> for leds-gpio you can use the properties 'function' and 'color' in the

> devicetree node and omit 'label', the label is constructed

> automatically.  This is a common feature supposed to be working for all

> LED drivers.  However it did not work until recently for the 'leds-pwm'

> driver.

> 

> [...]


Applied, thanks!

[1/2] ARM: dts: at91: smartkiz: Reference led node directly
      commit: 02e46262af5db410da5a27783833d68e2bdfb352
[2/2] ARM: dts: at91: Fix schema warnings for pwm-leds
      commit: 997ebd64df39f3916c37ca67a6eff58e79a13c73

Best regards,
-- 
Alexandre Belloni <alexandre.belloni@bootlin.com>
Alexandre Belloni Oct. 28, 2020, 7:21 p.m. UTC | #9
On 28/10/2020 19:56:14+0100, Alexandre Belloni wrote:
> On Mon, 5 Oct 2020 22:34:39 +0200, Alexander Dahl wrote:

> > Hei hei,

> > 

> > for leds-gpio you can use the properties 'function' and 'color' in the

> > devicetree node and omit 'label', the label is constructed

> > automatically.  This is a common feature supposed to be working for all

> > LED drivers.  However it did not work until recently for the 'leds-pwm'

> > driver.

> > 

> > [...]

> 

> Applied, thanks!

> 

> [1/2] ARM: dts: at91: smartkiz: Reference led node directly

>       commit: 02e46262af5db410da5a27783833d68e2bdfb352

> [2/2] ARM: dts: at91: Fix schema warnings for pwm-leds

>       commit: 997ebd64df39f3916c37ca67a6eff58e79a13c73


This was obviously 04/12 and 05/12.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Alexander Dahl Oct. 28, 2020, 8:39 p.m. UTC | #10
Hello,

Peter, Russel, could you please give your Acked-by or Signed-off-by on
this patch?  Your ack is needed, because the license is now explicitly
set (it was not explicit before), and you were the contributors to
this binding before the conversion to yaml.

Thanks and Greets
Alex

On Mon, Oct 05, 2020 at 10:34:41PM +0200, Alexander Dahl wrote:
> The example was adapted in the following ways:
> 
> - make use of the now supported 'function' and 'color' properties
> - remove pwm nodes, those are documented elsewhere
> - align node names to new dt schema rules and dt recommendations
> 
> License was not explicitly set before.  The license set now is
> recommended by DT project.
> 
> Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> Signed-off-by: Alexander Dahl <post@lespocky.de>
> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Cc: Russell King <linux@armlinux.org.uk>
> ---
> 
> Notes:
>     NOTE: Due to license set/change this needs Acked-by or Signed-off-by from:
>       * Peter Ujfalusi
>       * Russell King
>     
>     That was discussed already with Peter (original author), still waiting
>     for Acked-by though …
>     
>     Changelog
>     ---------
>     v6 -> v7:
>       * added Reviewed-by (Krzysztof Kozlowski)
>       * reworded commit message (suggested by Krzysztof)
>       * added Reviewed-by (Rob Herring)
>     
>     v5 -> v6:
>       * removed pwm nodes from example (Rob)
>       * renamed led-controller node in example (Rob)
>     
>     v4 -> v5:
>       * updated based on feedback by Rob Herring
>       * removed Acked-by
>     
>     v3 -> v4:
>       * added Cc to original author of the binding
>     
>     v2 -> v3:
>       * changed license identifier to recommended one
>       * added Acked-by
>     
>     v2:
>       * added this patch to series (Suggested-by: Jacek Anaszewski)
> 
>  .../devicetree/bindings/leds/leds-pwm.txt     | 50 -------------
>  .../devicetree/bindings/leds/leds-pwm.yaml    | 70 +++++++++++++++++++
>  2 files changed, 70 insertions(+), 50 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.txt
>  create mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.yaml
> 
> diff --git a/Documentation/devicetree/bindings/leds/leds-pwm.txt b/Documentation/devicetree/bindings/leds/leds-pwm.txt
> deleted file mode 100644
> index 6c6583c35f2f..000000000000
> --- a/Documentation/devicetree/bindings/leds/leds-pwm.txt
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -LED connected to PWM
> -
> -Required properties:
> -- compatible : should be "pwm-leds".
> -
> -Each LED is represented as a sub-node of the pwm-leds device.  Each
> -node's name represents the name of the corresponding LED.
> -
> -LED sub-node properties:
> -- pwms : PWM property to point to the PWM device (phandle)/port (id) and to
> -  specify the period time to be used: <&phandle id period_ns>;
> -- pwm-names : (optional) Name to be used by the PWM subsystem for the PWM device
> -  For the pwms and pwm-names property please refer to:
> -  Documentation/devicetree/bindings/pwm/pwm.txt
> -- max-brightness : Maximum brightness possible for the LED
> -- active-low : (optional) For PWMs where the LED is wired to supply
> -  rather than ground.
> -- label :  (optional)
> -  see Documentation/devicetree/bindings/leds/common.txt
> -- linux,default-trigger :  (optional)
> -  see Documentation/devicetree/bindings/leds/common.txt
> -
> -Example:
> -
> -twl_pwm: pwm {
> -	/* provides two PWMs (id 0, 1 for PWM1 and PWM2) */
> -	compatible = "ti,twl6030-pwm";
> -	#pwm-cells = <2>;
> -};
> -
> -twl_pwmled: pwmled {
> -	/* provides one PWM (id 0 for Charing indicator LED) */
> -	compatible = "ti,twl6030-pwmled";
> -	#pwm-cells = <2>;
> -};
> -
> -pwmleds {
> -	compatible = "pwm-leds";
> -	kpad {
> -		label = "omap4::keypad";
> -		pwms = <&twl_pwm 0 7812500>;
> -		max-brightness = <127>;
> -	};
> -
> -	charging {
> -		label = "omap4:green:chrg";
> -		pwms = <&twl_pwmled 0 7812500>;
> -		max-brightness = <255>;
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/leds/leds-pwm.yaml b/Documentation/devicetree/bindings/leds/leds-pwm.yaml
> new file mode 100644
> index 000000000000..fe4d5fd25913
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/leds-pwm.yaml
> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/leds-pwm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: LEDs connected to PWM
> +
> +maintainers:
> +  - Pavel Machek <pavel@ucw.cz>
> +
> +description:
> +  Each LED is represented as a sub-node of the pwm-leds device.  Each
> +  node's name represents the name of the corresponding LED.
> +
> +properties:
> +  compatible:
> +    const: pwm-leds
> +
> +patternProperties:
> +  "^led(-[0-9a-f]+)?$":
> +    type: object
> +
> +    $ref: common.yaml#
> +
> +    properties:
> +      pwms:
> +        maxItems: 1
> +
> +      pwm-names: true
> +
> +      max-brightness:
> +        description:
> +          Maximum brightness possible for the LED
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +
> +      active-low:
> +        description:
> +          For PWMs where the LED is wired to supply rather than ground.
> +        type: boolean
> +
> +    required:
> +      - pwms
> +      - max-brightness
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +
> +    #include <dt-bindings/leds/common.h>
> +
> +    led-controller {
> +        compatible = "pwm-leds";
> +
> +        led-1 {
> +            label = "omap4::keypad";
> +            pwms = <&twl_pwm 0 7812500>;
> +            max-brightness = <127>;
> +        };
> +
> +        led-2 {
> +            color = <LED_COLOR_ID_GREEN>;
> +            function = LED_FUNCTION_CHARGING;
> +            pwms = <&twl_pwmled 0 7812500>;
> +            max-brightness = <255>;
> +        };
> +    };
> +
> +...
> -- 
> 2.20.1
Russell King (Oracle) Oct. 29, 2020, 1:46 p.m. UTC | #11
On Wed, Oct 28, 2020 at 09:39:54PM +0100, Alexander Dahl wrote:
> Hello,
> 
> Peter, Russel, could you please give your Acked-by or Signed-off-by on
> this patch?  Your ack is needed, because the license is now explicitly
> set (it was not explicit before), and you were the contributors to
> this binding before the conversion to yaml.

For the license change only:

Acked-by: Russell King <rmk+kernel@armlinux.org.uk>

(Please drop the Cc attributation in the commit to
linux@armlinux.org.uk thanks.)

> 
> Thanks and Greets
> Alex
> 
> On Mon, Oct 05, 2020 at 10:34:41PM +0200, Alexander Dahl wrote:
> > The example was adapted in the following ways:
> > 
> > - make use of the now supported 'function' and 'color' properties
> > - remove pwm nodes, those are documented elsewhere
> > - align node names to new dt schema rules and dt recommendations
> > 
> > License was not explicitly set before.  The license set now is
> > recommended by DT project.
> > 
> > Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> > Signed-off-by: Alexander Dahl <post@lespocky.de>
> > Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> > Cc: Russell King <linux@armlinux.org.uk>
> > ---
> > 
> > Notes:
> >     NOTE: Due to license set/change this needs Acked-by or Signed-off-by from:
> >       * Peter Ujfalusi
> >       * Russell King
> >     
> >     That was discussed already with Peter (original author), still waiting
> >     for Acked-by though …
> >     
> >     Changelog
> >     ---------
> >     v6 -> v7:
> >       * added Reviewed-by (Krzysztof Kozlowski)
> >       * reworded commit message (suggested by Krzysztof)
> >       * added Reviewed-by (Rob Herring)
> >     
> >     v5 -> v6:
> >       * removed pwm nodes from example (Rob)
> >       * renamed led-controller node in example (Rob)
> >     
> >     v4 -> v5:
> >       * updated based on feedback by Rob Herring
> >       * removed Acked-by
> >     
> >     v3 -> v4:
> >       * added Cc to original author of the binding
> >     
> >     v2 -> v3:
> >       * changed license identifier to recommended one
> >       * added Acked-by
> >     
> >     v2:
> >       * added this patch to series (Suggested-by: Jacek Anaszewski)
> > 
> >  .../devicetree/bindings/leds/leds-pwm.txt     | 50 -------------
> >  .../devicetree/bindings/leds/leds-pwm.yaml    | 70 +++++++++++++++++++
> >  2 files changed, 70 insertions(+), 50 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.txt
> >  create mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/leds/leds-pwm.txt b/Documentation/devicetree/bindings/leds/leds-pwm.txt
> > deleted file mode 100644
> > index 6c6583c35f2f..000000000000
> > --- a/Documentation/devicetree/bindings/leds/leds-pwm.txt
> > +++ /dev/null
> > @@ -1,50 +0,0 @@
> > -LED connected to PWM
> > -
> > -Required properties:
> > -- compatible : should be "pwm-leds".
> > -
> > -Each LED is represented as a sub-node of the pwm-leds device.  Each
> > -node's name represents the name of the corresponding LED.
> > -
> > -LED sub-node properties:
> > -- pwms : PWM property to point to the PWM device (phandle)/port (id) and to
> > -  specify the period time to be used: <&phandle id period_ns>;
> > -- pwm-names : (optional) Name to be used by the PWM subsystem for the PWM device
> > -  For the pwms and pwm-names property please refer to:
> > -  Documentation/devicetree/bindings/pwm/pwm.txt
> > -- max-brightness : Maximum brightness possible for the LED
> > -- active-low : (optional) For PWMs where the LED is wired to supply
> > -  rather than ground.
> > -- label :  (optional)
> > -  see Documentation/devicetree/bindings/leds/common.txt
> > -- linux,default-trigger :  (optional)
> > -  see Documentation/devicetree/bindings/leds/common.txt
> > -
> > -Example:
> > -
> > -twl_pwm: pwm {
> > -	/* provides two PWMs (id 0, 1 for PWM1 and PWM2) */
> > -	compatible = "ti,twl6030-pwm";
> > -	#pwm-cells = <2>;
> > -};
> > -
> > -twl_pwmled: pwmled {
> > -	/* provides one PWM (id 0 for Charing indicator LED) */
> > -	compatible = "ti,twl6030-pwmled";
> > -	#pwm-cells = <2>;
> > -};
> > -
> > -pwmleds {
> > -	compatible = "pwm-leds";
> > -	kpad {
> > -		label = "omap4::keypad";
> > -		pwms = <&twl_pwm 0 7812500>;
> > -		max-brightness = <127>;
> > -	};
> > -
> > -	charging {
> > -		label = "omap4:green:chrg";
> > -		pwms = <&twl_pwmled 0 7812500>;
> > -		max-brightness = <255>;
> > -	};
> > -};
> > diff --git a/Documentation/devicetree/bindings/leds/leds-pwm.yaml b/Documentation/devicetree/bindings/leds/leds-pwm.yaml
> > new file mode 100644
> > index 000000000000..fe4d5fd25913
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/leds/leds-pwm.yaml
> > @@ -0,0 +1,70 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/leds/leds-pwm.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: LEDs connected to PWM
> > +
> > +maintainers:
> > +  - Pavel Machek <pavel@ucw.cz>
> > +
> > +description:
> > +  Each LED is represented as a sub-node of the pwm-leds device.  Each
> > +  node's name represents the name of the corresponding LED.
> > +
> > +properties:
> > +  compatible:
> > +    const: pwm-leds
> > +
> > +patternProperties:
> > +  "^led(-[0-9a-f]+)?$":
> > +    type: object
> > +
> > +    $ref: common.yaml#
> > +
> > +    properties:
> > +      pwms:
> > +        maxItems: 1
> > +
> > +      pwm-names: true
> > +
> > +      max-brightness:
> > +        description:
> > +          Maximum brightness possible for the LED
> > +        $ref: /schemas/types.yaml#/definitions/uint32
> > +
> > +      active-low:
> > +        description:
> > +          For PWMs where the LED is wired to supply rather than ground.
> > +        type: boolean
> > +
> > +    required:
> > +      - pwms
> > +      - max-brightness
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +
> > +    #include <dt-bindings/leds/common.h>
> > +
> > +    led-controller {
> > +        compatible = "pwm-leds";
> > +
> > +        led-1 {
> > +            label = "omap4::keypad";
> > +            pwms = <&twl_pwm 0 7812500>;
> > +            max-brightness = <127>;
> > +        };
> > +
> > +        led-2 {
> > +            color = <LED_COLOR_ID_GREEN>;
> > +            function = LED_FUNCTION_CHARGING;
> > +            pwms = <&twl_pwmled 0 7812500>;
> > +            max-brightness = <255>;
> > +        };
> > +    };
> > +
> > +...
> > -- 
> > 2.20.1
> 
> -- 
> /"\ ASCII RIBBON | »With the first link, the chain is forged. The first
> \ / CAMPAIGN     | speech censured, the first thought forbidden, the
>  X  AGAINST      | first freedom denied, chains us all irrevocably.«
> / \ HTML MAIL    | (Jean-Luc Picard, quoting Judge Aaron Satie)