linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] leds: pwm: Make automatic labels work
@ 2020-08-31 21:02 Alexander Dahl
  2020-08-31 21:02 ` [PATCH v2 1/2] leds: pwm: Allow automatic labels for DT based devices Alexander Dahl
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Alexander Dahl @ 2020-08-31 21:02 UTC (permalink / raw)
  To: linux-leds, devicetree
  Cc: Jacek Anaszewski, Pavel Machek, Dan Murphy, Rob Herring,
	linux-kernel, Alexander Dahl, Alexander Dahl

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 yet work for the 'leds-pwm' driver.
This series fixes the driver and takes the opportunity to update the
dt-bindings accordingly.

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

v2: based on v5.9-rc3, added the dt-bindings update patch

Greets
Alex

Alexander Dahl (2):
  leds: pwm: Allow automatic labels for DT based devices
  dt-bindings: leds: Convert pwm to yaml

 .../devicetree/bindings/leds/leds-pwm.txt     | 50 -----------
 .../devicetree/bindings/leds/leds-pwm.yaml    | 85 +++++++++++++++++++
 drivers/leds/leds-pwm.c                       |  9 +-
 3 files changed, 93 insertions(+), 51 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.txt
 create mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.yaml

-- 
2.20.1


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

* [PATCH v2 1/2] leds: pwm: Allow automatic labels for DT based devices
  2020-08-31 21:02 [PATCH v2 0/2] leds: pwm: Make automatic labels work Alexander Dahl
@ 2020-08-31 21:02 ` Alexander Dahl
  2020-08-31 21:02 ` [PATCH v2 2/2] dt-bindings: leds: Convert pwm to yaml Alexander Dahl
  2020-09-01 21:08 ` [PATCH v2 0/2] leds: pwm: Make automatic labels work Jacek Anaszewski
  2 siblings, 0 replies; 10+ messages in thread
From: Alexander Dahl @ 2020-08-31 21:02 UTC (permalink / raw)
  To: linux-leds, devicetree
  Cc: Jacek Anaszewski, Pavel Machek, Dan Murphy, Rob Herring,
	linux-kernel, Alexander Dahl, Alexander Dahl

If LEDs are configured through device tree and the property 'label' is
omitted, the label is supposed to be generated from the properties
'function' and 'color' if present.  While this works fine for e.g. the
'leds-gpio' driver, it did not for 'leds-pwm'.

The reason is, you get this label naming magic only if you add a LED
device through 'devm_led_classdev_register_ext()' and pass a pointer to
the current device tree node.  The approach to fix this was adopted from
the 'leds-gpio' driver.

For the following node from dts the LED appeared as 'led5' in sysfs
before and as 'red:debug' after this change.

        pwm_leds {
                compatible = "pwm-leds";

                led5 {
                        function = LED_FUNCTION_DEBUG;
                        color = <LED_COLOR_ID_RED>;
                        pwms = <&pwm0 2 10000000 0>;
                        max-brightness = <127>;

                        linux,default-trigger = "heartbeat";
                        panic-indicator;
                };
        };

Signed-off-by: Alexander Dahl <post@lespocky.de>
---
 drivers/leds/leds-pwm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index ef7b91bd2064..a27a1d75a3e9 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -65,6 +65,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
 		       struct led_pwm *led, struct fwnode_handle *fwnode)
 {
 	struct led_pwm_data *led_data = &priv->leds[priv->num_leds];
+	struct led_init_data init_data = {};
 	int ret;
 
 	led_data->active_low = led->active_low;
@@ -90,7 +91,13 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
 
 	pwm_init_state(led_data->pwm, &led_data->pwmstate);
 
-	ret = devm_led_classdev_register(dev, &led_data->cdev);
+	if (fwnode) {
+		init_data.fwnode = fwnode;
+		ret = devm_led_classdev_register_ext(dev, &led_data->cdev,
+						     &init_data);
+	} else {
+		ret = devm_led_classdev_register(dev, &led_data->cdev);
+	}
 	if (ret) {
 		dev_err(dev, "failed to register PWM led for %s: %d\n",
 			led->name, ret);
-- 
2.20.1


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

* [PATCH v2 2/2] dt-bindings: leds: Convert pwm to yaml
  2020-08-31 21:02 [PATCH v2 0/2] leds: pwm: Make automatic labels work Alexander Dahl
  2020-08-31 21:02 ` [PATCH v2 1/2] leds: pwm: Allow automatic labels for DT based devices Alexander Dahl
@ 2020-08-31 21:02 ` Alexander Dahl
  2020-08-31 21:31   ` Alexander Dahl
  2020-09-01 21:08 ` [PATCH v2 0/2] leds: pwm: Make automatic labels work Jacek Anaszewski
  2 siblings, 1 reply; 10+ messages in thread
From: Alexander Dahl @ 2020-08-31 21:02 UTC (permalink / raw)
  To: linux-leds, devicetree
  Cc: Jacek Anaszewski, Pavel Machek, Dan Murphy, Rob Herring,
	linux-kernel, Alexander Dahl, Alexander Dahl

The example was adapted slightly to make use of the 'function' and
'color' properties.

Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: Alexander Dahl <post@lespocky.de>
---
 .../devicetree/bindings/leds/leds-pwm.txt     | 50 -----------
 .../devicetree/bindings/leds/leds-pwm.yaml    | 85 +++++++++++++++++++
 2 files changed, 85 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..8c5217f2a9f7
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-pwm.yaml
@@ -0,0 +1,85 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%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:
+  "^pwm-led-([0-9a-f])$":
+    type: object
+
+    $ref: common.yaml#
+
+    properties:
+      pwms:
+        description:
+          "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:
+        description:
+          "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:
+        description:
+          Maximum brightness possible for the LED
+
+      active-low:
+        description:
+          For PWMs where the LED is wired to supply rather than ground.
+
+    required:
+      - pwms
+      - max-brightness
+
+examples:
+  - |
+
+    #include <dt-bindings/leds/common.h>
+
+    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>;
+    };
+
+    pwm_leds {
+        compatible = "pwm-leds";
+
+        pwm-led-1 {
+            label = "omap4::keypad";
+            pwms = <&twl_pwm 0 7812500>;
+            max-brightness = <127>;
+        };
+
+        pwm-led-2 {
+            color = <LED_COLOR_ID_GREEN>;
+            function = LED_FUNCTION_CHARGING;
+            pwms = <&twl_pwmled 0 7812500>;
+            max-brightness = <255>;
+        };
+    };
+
+...
-- 
2.20.1


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

* Re: [PATCH v2 2/2] dt-bindings: leds: Convert pwm to yaml
  2020-08-31 21:02 ` [PATCH v2 2/2] dt-bindings: leds: Convert pwm to yaml Alexander Dahl
@ 2020-08-31 21:31   ` Alexander Dahl
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander Dahl @ 2020-08-31 21:31 UTC (permalink / raw)
  To: linux-leds, devicetree
  Cc: Jacek Anaszewski, Pavel Machek, Dan Murphy, Rob Herring,
	linux-kernel, Alexander Dahl, Alexander Dahl

[-- Attachment #1: Type: text/plain, Size: 5814 bytes --]

Hei hei,

I forgot to run checkpatch (it's late today already), and it warns:

  WARNING: DT binding documents should be licensed (GPL-2.0-only OR BSD-2-Clause)
  #80: FILE: Documentation/devicetree/bindings/leds/leds-pwm.yaml:1:
  +# SPDX-License-Identifier: GPL-2.0-only

tbh, I just copied that line from leds-gpio.yaml, can be changed in a
v3 of course.

Greets
Alex

On Mon, Aug 31, 2020 at 11:02:31PM +0200, Alexander Dahl wrote:
> The example was adapted slightly to make use of the 'function' and
> 'color' properties.
> 
> Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> Signed-off-by: Alexander Dahl <post@lespocky.de>
> ---
>  .../devicetree/bindings/leds/leds-pwm.txt     | 50 -----------
>  .../devicetree/bindings/leds/leds-pwm.yaml    | 85 +++++++++++++++++++
>  2 files changed, 85 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..8c5217f2a9f7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/leds-pwm.yaml
> @@ -0,0 +1,85 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +%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:
> +  "^pwm-led-([0-9a-f])$":
> +    type: object
> +
> +    $ref: common.yaml#
> +
> +    properties:
> +      pwms:
> +        description:
> +          "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:
> +        description:
> +          "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:
> +        description:
> +          Maximum brightness possible for the LED
> +
> +      active-low:
> +        description:
> +          For PWMs where the LED is wired to supply rather than ground.
> +
> +    required:
> +      - pwms
> +      - max-brightness
> +
> +examples:
> +  - |
> +
> +    #include <dt-bindings/leds/common.h>
> +
> +    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>;
> +    };
> +
> +    pwm_leds {
> +        compatible = "pwm-leds";
> +
> +        pwm-led-1 {
> +            label = "omap4::keypad";
> +            pwms = <&twl_pwm 0 7812500>;
> +            max-brightness = <127>;
> +        };
> +
> +        pwm-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)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2 0/2] leds: pwm: Make automatic labels work
  2020-08-31 21:02 [PATCH v2 0/2] leds: pwm: Make automatic labels work Alexander Dahl
  2020-08-31 21:02 ` [PATCH v2 1/2] leds: pwm: Allow automatic labels for DT based devices Alexander Dahl
  2020-08-31 21:02 ` [PATCH v2 2/2] dt-bindings: leds: Convert pwm to yaml Alexander Dahl
@ 2020-09-01 21:08 ` Jacek Anaszewski
  2020-09-04  7:53   ` Alexander Dahl
  2 siblings, 1 reply; 10+ messages in thread
From: Jacek Anaszewski @ 2020-09-01 21:08 UTC (permalink / raw)
  To: Alexander Dahl, linux-leds, devicetree
  Cc: Pavel Machek, Dan Murphy, Rob Herring, linux-kernel, Alexander Dahl

Hi Alexander,

Thanks for the v2.

On 8/31/20 11:02 PM, 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 yet work for the 'leds-pwm' driver.
> This series fixes the driver and takes the opportunity to update the
> dt-bindings accordingly.
> 
> v1: based on v5.9-rc2, backport on v5.4.59 tested and working
> 
> v2: based on v5.9-rc3, added the dt-bindings update patch
> 
> Greets
> Alex
> 
> Alexander Dahl (2):
>    leds: pwm: Allow automatic labels for DT based devices
>    dt-bindings: leds: Convert pwm to yaml
> 
>   .../devicetree/bindings/leds/leds-pwm.txt     | 50 -----------
>   .../devicetree/bindings/leds/leds-pwm.yaml    | 85 +++++++++++++++++++
>   drivers/leds/leds-pwm.c                       |  9 +-
>   3 files changed, 93 insertions(+), 51 deletions(-)
>   delete mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.txt
>   create mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.yaml
> 

For both patches:

Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

-- 
Best regards,
Jacek Anaszewski

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

* Re: [PATCH v2 0/2] leds: pwm: Make automatic labels work
  2020-09-01 21:08 ` [PATCH v2 0/2] leds: pwm: Make automatic labels work Jacek Anaszewski
@ 2020-09-04  7:53   ` Alexander Dahl
  2020-09-04 21:19     ` Jacek Anaszewski
  2020-09-09  9:00     ` Pavel Machek
  0 siblings, 2 replies; 10+ messages in thread
From: Alexander Dahl @ 2020-09-04  7:53 UTC (permalink / raw)
  To: linux-leds
  Cc: Jacek Anaszewski, Alexander Dahl, devicetree, Pavel Machek,
	Dan Murphy, Rob Herring, linux-kernel

Hi Jacek,

Am Dienstag, 1. September 2020, 23:08:09 CEST schrieb Jacek Anaszewski:
> Hi Alexander,
> 
> Thanks for the v2.
> 
> On 8/31/20 11:02 PM, 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 yet work for the 'leds-pwm' driver.
> > This series fixes the driver and takes the opportunity to update the
> > dt-bindings accordingly.
> > 
> > v1: based on v5.9-rc2, backport on v5.4.59 tested and working
> > 
> > v2: based on v5.9-rc3, added the dt-bindings update patch
> > 
> > Greets
> > Alex
> > 
> > Alexander Dahl (2):
> >    leds: pwm: Allow automatic labels for DT based devices
> >    dt-bindings: leds: Convert pwm to yaml
> >   
> >   .../devicetree/bindings/leds/leds-pwm.txt     | 50 -----------
> >   .../devicetree/bindings/leds/leds-pwm.yaml    | 85 +++++++++++++++++++
> >   drivers/leds/leds-pwm.c                       |  9 +-
> >   3 files changed, 93 insertions(+), 51 deletions(-)
> >   delete mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.txt
> >   create mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.yaml
> 
> For both patches:
> 
> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

I'd like to make a v3 and change the license of the .yaml file to "(GPL-2.0-
only OR BSD-2-Clause)" as suggested by checkpatch and [1].  Can I keep your 
Acked-by for that?

Besides: those suggestions are obviously valid for new bindings.  What about 
old bindings (.txt), which had no explicit SPDX tag or license note before?  
What license would apply there?  Is the .yaml file technically new, when it 
was mostly just converted from .txt?

Greets
Alex

[1] https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html




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

* Re: [PATCH v2 0/2] leds: pwm: Make automatic labels work
  2020-09-04  7:53   ` Alexander Dahl
@ 2020-09-04 21:19     ` Jacek Anaszewski
  2020-09-09  9:00     ` Pavel Machek
  1 sibling, 0 replies; 10+ messages in thread
From: Jacek Anaszewski @ 2020-09-04 21:19 UTC (permalink / raw)
  To: Alexander Dahl, linux-leds
  Cc: Alexander Dahl, devicetree, Pavel Machek, Dan Murphy,
	Rob Herring, linux-kernel

Hi Alexander,

On 9/4/20 9:53 AM, Alexander Dahl wrote:
> Hi Jacek,
> 
> Am Dienstag, 1. September 2020, 23:08:09 CEST schrieb Jacek Anaszewski:
>> Hi Alexander,
>>
>> Thanks for the v2.
>>
>> On 8/31/20 11:02 PM, 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 yet work for the 'leds-pwm' driver.
>>> This series fixes the driver and takes the opportunity to update the
>>> dt-bindings accordingly.
>>>
>>> v1: based on v5.9-rc2, backport on v5.4.59 tested and working
>>>
>>> v2: based on v5.9-rc3, added the dt-bindings update patch
>>>
>>> Greets
>>> Alex
>>>
>>> Alexander Dahl (2):
>>>     leds: pwm: Allow automatic labels for DT based devices
>>>     dt-bindings: leds: Convert pwm to yaml
>>>    
>>>    .../devicetree/bindings/leds/leds-pwm.txt     | 50 -----------
>>>    .../devicetree/bindings/leds/leds-pwm.yaml    | 85 +++++++++++++++++++
>>>    drivers/leds/leds-pwm.c                       |  9 +-
>>>    3 files changed, 93 insertions(+), 51 deletions(-)
>>>    delete mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.txt
>>>    create mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.yaml
>>
>> For both patches:
>>
>> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> 
> I'd like to make a v3 and change the license of the .yaml file to "(GPL-2.0-
> only OR BSD-2-Clause)" as suggested by checkpatch and [1].  Can I keep your
> Acked-by for that?

Go ahead.

> Besides: those suggestions are obviously valid for new bindings.  What about
> old bindings (.txt), which had no explicit SPDX tag or license note before?
> What license would apply there?  Is the .yaml file technically new, when it
> was mostly just converted from .txt?

I don't know what was the rationale behind adding license to
DT bindings, probably Rob will be able to share some details.

Possibly the fact that DT examples can be now compile-tested
makes some difference here.

-- 
Best regards,
Jacek Anaszewski

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

* Re: [PATCH v2 0/2] leds: pwm: Make automatic labels work
  2020-09-04  7:53   ` Alexander Dahl
  2020-09-04 21:19     ` Jacek Anaszewski
@ 2020-09-09  9:00     ` Pavel Machek
  2020-09-09  9:22       ` Alexander Dahl
  1 sibling, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2020-09-09  9:00 UTC (permalink / raw)
  To: Alexander Dahl
  Cc: linux-leds, Jacek Anaszewski, Alexander Dahl, devicetree,
	Dan Murphy, Rob Herring, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]

Hi!

> > > 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 yet work for the 'leds-pwm' driver.
> > > This series fixes the driver and takes the opportunity to update the
> > > dt-bindings accordingly.
> > > 
> > > v1: based on v5.9-rc2, backport on v5.4.59 tested and working
> > > 
> > > v2: based on v5.9-rc3, added the dt-bindings update patch
> > > 
> > > Greets
> > > Alex
> > > 
> > > Alexander Dahl (2):
> > >    leds: pwm: Allow automatic labels for DT based devices
> > >    dt-bindings: leds: Convert pwm to yaml
> > >   
> > >   .../devicetree/bindings/leds/leds-pwm.txt     | 50 -----------
> > >   .../devicetree/bindings/leds/leds-pwm.yaml    | 85 +++++++++++++++++++
> > >   drivers/leds/leds-pwm.c                       |  9 +-
> > >   3 files changed, 93 insertions(+), 51 deletions(-)
> > >   delete mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.txt
> > >   create mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.yaml
> > 
> > For both patches:
> > 
> > Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> 
> I'd like to make a v3 and change the license of the .yaml file to "(GPL-2.0-
> only OR BSD-2-Clause)" as suggested by checkpatch and [1].  Can I keep your 
> Acked-by for that?
> 
> Besides: those suggestions are obviously valid for new bindings.  What about 
> old bindings (.txt), which had no explicit SPDX tag or license note before?  
> What license would apply there?  Is the .yaml file technically new, when it 
> was mostly just converted from .txt?

If it is based on previous .txt binding, you have to respect previous
author's license. That probably means GPL-2.0 only.

Alternatively, you can contact original author(s) to get permission to
relicense under (GPL-2.0-only OR BSD-2-Clause).

Best regards,
									Pavel
-- 
(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] 10+ messages in thread

* Re: [PATCH v2 0/2] leds: pwm: Make automatic labels work
  2020-09-09  9:00     ` Pavel Machek
@ 2020-09-09  9:22       ` Alexander Dahl
  2020-09-09  9:27         ` Pavel Machek
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Dahl @ 2020-09-09  9:22 UTC (permalink / raw)
  To: Pavel Machek
  Cc: linux-leds, Jacek Anaszewski, Alexander Dahl, devicetree,
	Dan Murphy, Rob Herring, linux-kernel

Hello Pavel,

Am Mittwoch, 9. September 2020, 11:00:33 CEST schrieb Pavel Machek:
> Hi!
> 
> > > > 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 yet work for the 'leds-pwm' driver.
> > > > This series fixes the driver and takes the opportunity to update the
> > > > dt-bindings accordingly.
> > > > 
> > > > v1: based on v5.9-rc2, backport on v5.4.59 tested and working
> > > > 
> > > > v2: based on v5.9-rc3, added the dt-bindings update patch
> > > > 
> > > > Greets
> > > > Alex
> > > > 
> > > > Alexander Dahl (2):
> > > >    leds: pwm: Allow automatic labels for DT based devices
> > > >    dt-bindings: leds: Convert pwm to yaml
> > > >   
> > > >   .../devicetree/bindings/leds/leds-pwm.txt     | 50 -----------
> > > >   .../devicetree/bindings/leds/leds-pwm.yaml    | 85
> > > >   +++++++++++++++++++
> > > >   drivers/leds/leds-pwm.c                       |  9 +-
> > > >   3 files changed, 93 insertions(+), 51 deletions(-)
> > > >   delete mode 100644
> > > >   Documentation/devicetree/bindings/leds/leds-pwm.txt
> > > >   create mode 100644
> > > >   Documentation/devicetree/bindings/leds/leds-pwm.yaml
> > > 
> > > For both patches:
> > > 
> > > Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> > 
> > I'd like to make a v3 and change the license of the .yaml file to
> > "(GPL-2.0- only OR BSD-2-Clause)" as suggested by checkpatch and [1]. 
> > Can I keep your Acked-by for that?
> > 
> > Besides: those suggestions are obviously valid for new bindings.  What
> > about old bindings (.txt), which had no explicit SPDX tag or license note
> > before? What license would apply there?  Is the .yaml file technically
> > new, when it was mostly just converted from .txt?
> 
> If it is based on previous .txt binding, you have to respect previous
> author's license. That probably means GPL-2.0 only.

Probably?

> Alternatively, you can contact original author(s) to get permission to
> relicense under (GPL-2.0-only OR BSD-2-Clause).

Judging from your feedback on v3, there will be a v4 anyways, so I contacted 
Peter Ujfalusi, who added the original .txt binding back in 2012 (merged in 
2013).

Thanks for your feedback
Alex




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

* Re: [PATCH v2 0/2] leds: pwm: Make automatic labels work
  2020-09-09  9:22       ` Alexander Dahl
@ 2020-09-09  9:27         ` Pavel Machek
  0 siblings, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2020-09-09  9:27 UTC (permalink / raw)
  To: Alexander Dahl
  Cc: linux-leds, Jacek Anaszewski, Alexander Dahl, devicetree,
	Dan Murphy, Rob Herring, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]

Hi!

> > > Besides: those suggestions are obviously valid for new bindings.  What
> > > about old bindings (.txt), which had no explicit SPDX tag or license note
> > > before? What license would apply there?  Is the .yaml file technically
> > > new, when it was mostly just converted from .txt?
> > 
> > If it is based on previous .txt binding, you have to respect previous
> > author's license. That probably means GPL-2.0 only.
> 
> Probably?

I have not checked exact licensing situation of that text, have not
decided if it was copyrightable in the first place, and am not a
lawyer.

So... probably :-).

Best regards,
									Pavel
-- 
(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] 10+ messages in thread

end of thread, other threads:[~2020-09-09  9:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31 21:02 [PATCH v2 0/2] leds: pwm: Make automatic labels work Alexander Dahl
2020-08-31 21:02 ` [PATCH v2 1/2] leds: pwm: Allow automatic labels for DT based devices Alexander Dahl
2020-08-31 21:02 ` [PATCH v2 2/2] dt-bindings: leds: Convert pwm to yaml Alexander Dahl
2020-08-31 21:31   ` Alexander Dahl
2020-09-01 21:08 ` [PATCH v2 0/2] leds: pwm: Make automatic labels work Jacek Anaszewski
2020-09-04  7:53   ` Alexander Dahl
2020-09-04 21:19     ` Jacek Anaszewski
2020-09-09  9:00     ` Pavel Machek
2020-09-09  9:22       ` Alexander Dahl
2020-09-09  9:27         ` Pavel Machek

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).