Skip to contentSkip to conversation

dt-bindings: pwm: Convert lpc32xx-pwm.txt to YAML

PATCH In review Purva Yeshi 4 participants 12 messages Mar 12, 2025 – Apr 4, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dt-bindings: pwm: Convert lpc32xx-pwm.txt to YAML

Convert the existing lpc32xx-pwm.txt bindings documentation into a YAML schema (nxp,lpc3220-pwm.yaml).

Set "#pwm-cells" to const: 3 for expected PWM cell properties.

---
V1 - https://lore.kernel.org/all/[email protected]/
V2 - Correct filename to match the compatible string, remove unnecessary quotes in maintainers, and refine commit message.

 .../devicetree/bindings/pwm/lpc32xx-pwm.txt   | 17 ---------
 .../bindings/pwm/nxp,lpc3220-pwm.yaml         | 38 +++++++++++++++++++
 2 files changed, 38 insertions(+), 17 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/pwm/lpc32xx-pwm.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml
Documentation/devicetree/bindings/pwm/lpc32xx-pwm.txt deleted +0 -17
deleted file mode 100644
index 74b5bc5dd..000000000
@@ -1,17 +0,0 @@
-LPC32XX PWM controller
-
-Required properties:
-- compatible: should be "nxp,lpc3220-pwm"
-- reg: physical base address and length of the controller's registers
-
-Examples:
-
-pwm@4005c000 {
-	compatible = "nxp,lpc3220-pwm";
-	reg = <0x4005c000 0x4>;
-};
-
-pwm@4005c004 {
-	compatible = "nxp,lpc3220-pwm";
-	reg = <0x4005c004 0x4>;
-};
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +38 -0
new file mode 100644
index 000000000..432a5e9d4
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/nxp,lpc3220-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LPC32XX PWM controller
+
+maintainers:
+  - Vladimir Zapolskiy <[email protected]>
+  - Piotr Wojtaszczyk <[email protected]>
+
+allOf:
+  - $ref: pwm.yaml#
+
+properties:
+  compatible:
+    const: nxp,lpc3220-pwm
+
+  reg:
+    maxItems: 1
+
+  "#pwm-cells":
+    const: 3
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    pwm@4005c000 {
+        compatible = "nxp,lpc3220-pwm";
+        reg = <0x4005c000 0x4>;
+        #pwm-cells = <3>;
+    };
Signature · 1 line
2.34.1
#1 lore raw

Hello Purva.

Thank you for your contribution.

Quoted 4 lines · Purva Yeshi

Convert the existing lpc32xx-pwm.txt bindings documentation into a YAML schema (nxp,lpc3220-pwm.yaml).

Set "#pwm-cells" to const: 3 for expected PWM cell properties.

Actually it shall be set to 1.

Quoted 56 lines

---
V1 - https://lore.kernel.org/all/[email protected]/
V2 - Correct filename to match the compatible string, remove unnecessary quotes in maintainers, and refine commit message.

  .../devicetree/bindings/pwm/lpc32xx-pwm.txt   | 17 ---------
  .../bindings/pwm/nxp,lpc3220-pwm.yaml         | 38 +++++++++++++++++++
  2 files changed, 38 insertions(+), 17 deletions(-)

delete mode 100644 Documentation/devicetree/bindings/pwm/lpc32xx-pwm.txt create mode 100644 Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml

Documentation/devicetree/bindings/pwm/lpc32xx-pwm.txt deleted +0 -17
deleted file mode 100644
index 74b5bc5dd..000000000
@@ -1,17 +0,0 @@
-LPC32XX PWM controller
-
-Required properties:
-- compatible: should be "nxp,lpc3220-pwm"
-- reg: physical base address and length of the controller's registers
-
-Examples:
-
-pwm@4005c000 {
-	compatible = "nxp,lpc3220-pwm";
-	reg = <0x4005c000 0x4>;
-};
-
-pwm@4005c004 {
-	compatible = "nxp,lpc3220-pwm";
-	reg = <0x4005c004 0x4>;
-};
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +14 -0
new file mode 100644
index 000000000..432a5e9d4
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/nxp,lpc3220-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LPC32XX PWM controller
+
+maintainers:
+  - Vladimir Zapolskiy <[email protected]>
+  - Piotr Wojtaszczyk <[email protected]>
+
+allOf:
+  - $ref: pwm.yaml#

Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml line 24

Quoted 10 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +10 -0
+
+properties:
+  compatible:
+    const: nxp,lpc3220-pwm
+
+  reg:
+    maxItems: 1
+
+  "#pwm-cells":
+    const: 3

It shall be 1.

Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml line 29

Quoted 5 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +5 -0
+
+required:
+  - compatible
+  - reg
+

There is an error in the original lpc32xx-pwm.txt file, one more property "clocks" is strictly required, please add it along with the conversion.

Thank you!

Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml line 38

Quoted 9 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +9 -0
+unevaluatedProperties: false
+
+examples:
+  - |
+    pwm@4005c000 {
+        compatible = "nxp,lpc3220-pwm";
+        reg = <0x4005c000 0x4>;
+        #pwm-cells = <3>;
+    };

--
Best wishes,
Vladimir

#2 lore raw

Hello,

Quoted 4 lines · Vladimir Zapolskiy

Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml line 24

Quoted 2 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +2 -0
+  "#pwm-cells":
+    const: 3

It shall be 1.

No, 3 is the right choice.

Best regards
Uwe

#3 lore raw

Hi Uwe,

Quoted 10 lines · Uwe Kleine-König

Hello,

Quoted 4 lines · Vladimir Zapolskiy

Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml line 24

Quoted 2 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +2 -0
+  "#pwm-cells":
+    const: 3

It shall be 1.

No, 3 is the right choice.

could you please elaborate?

I find that here the only configurable parameter is PWM period, so it should be sufficient to have one cell only like in marvell,pxa-pwm.yaml or google,cros-ec-pwm.yaml.

--
Best wishes,
Vladimir

#4 lore raw

Hello Vladimir,

Quoted 9 lines · Vladimir Zapolskiy
Quoted 8 lines · Uwe Kleine-König

Hello,

Quoted 4 lines · Vladimir Zapolskiy

Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml line 24

Quoted 2 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +2 -0
+  "#pwm-cells":
+    const: 3

It shall be 1.

Quoted 8 lines
Quoted 2 lines

No, 3 is the right choice.

could you please elaborate?

I find that here the only configurable parameter is PWM period, so it should be sufficient to have one cell only like in marvell,pxa-pwm.yaml or google,cros-ec-pwm.yaml.

These two bindings are special snow-flakes and the only drivers that have #pwm-cells = <1>. Most other bindings use 3 and since commit 895fe4537cc8 ("pwm: Add upgrade path to #pwm-cells = <3> for users of of_pwm_single_xlate()") (which was created for the pxa driver) the pxa driver also supports 3 cells. The cros-ec driver even has comment about that being ugly.

I intend to convert all bindings to use 3 soon.

While that isn't necessary for each individual piece of hardware to provide 3 values, having a uniform binding for PWMs provides a nice user experience and also simplifies matters with nexus nodes (see e71e46a6f19c ("pwm: Add support for pwm nexus dt bindings")).

Best regards
Uwe

Reviewed-by on v2 1/1
#5 lore raw
In reply to Purva Yeshi
Quoted 7 lines · Purva Yeshi

Convert the existing lpc32xx-pwm.txt bindings documentation into a YAML schema (nxp,lpc3220-pwm.yaml).

Set "#pwm-cells" to const: 3 for expected PWM cell properties.

---

---

<form letter>
This is an automated instruction, just in case, because many review tags are being ignored. If you know the process, you can skip it (please do not feel offended by me posting it here - no bad intentions intended). If you do not know the process, here is a short explanation:

Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply.

Full context and explanation:
https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577
</form letter>

Best regards,
Krzysztof

#6 lore raw
Quoted 28 lines · Krzysztof Kozlowski
Quoted 7 lines · Purva Yeshi

Convert the existing lpc32xx-pwm.txt bindings documentation into a YAML schema (nxp,lpc3220-pwm.yaml).

Set "#pwm-cells" to const: 3 for expected PWM cell properties.

---

---

<form letter>
This is an automated instruction, just in case, because many review tags are being ignored. If you know the process, you can skip it (please do not feel offended by me posting it here - no bad intentions intended). If you do not know the process, here is a short explanation:

Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply.

Quoted 6 lines

Full context and explanation:
https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577
</form letter>

Best regards,
Krzysztof

Hi Krzysztof,

Thank you for your review! I will include your Reviewed-by tag in the next version if no significant changes are made.

Best regards,
Purva Yeshi

#7 lore raw
In reply to Krzysztof Kozlowski
Quoted 28 lines · Krzysztof Kozlowski
Quoted 7 lines · Purva Yeshi

Convert the existing lpc32xx-pwm.txt bindings documentation into a YAML schema (nxp,lpc3220-pwm.yaml).

Set "#pwm-cells" to const: 3 for expected PWM cell properties.

---

---

<form letter>
This is an automated instruction, just in case, because many review tags are being ignored. If you know the process, you can skip it (please do not feel offended by me posting it here - no bad intentions intended). If you do not know the process, here is a short explanation:

Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply.

Quoted 6 lines

Full context and explanation:
https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577
</form letter>

Best regards,
Krzysztof

Hello!

I wanted to follow up on the patch I submitted. I was wondering if you had a chance to review it and if there are any comments or feedback.

Thank you for your time and consideration. I look forward to your response.

Best regards,
Purva Yeshi

#8 lore raw
Quoted 33 lines · Purva Yeshi
Quoted 32 lines · Krzysztof Kozlowski
Quoted 7 lines · Purva Yeshi

Convert the existing lpc32xx-pwm.txt bindings documentation into a YAML schema (nxp,lpc3220-pwm.yaml).

Set "#pwm-cells" to const: 3 for expected PWM cell properties.

---

---

<form letter>
This is an automated instruction, just in case, because many review tags are being ignored. If you know the process, you can skip it (please do not feel offended by me posting it here - no bad intentions intended). If you do not know the process, here is a short explanation:

Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply.

Full context and explanation:
https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577
</form letter>

Quoted 7 lines
Quoted 2 lines

Best regards,
Krzysztof

Hello!

I wanted to follow up on the patch I submitted. I was wondering if you had a chance to review it and if there are any comments or feedback.

And what did you quote? What's there? Did you read it before replying?

Please avoid pinging during the merge window.

Best regards,
Krzysztof

#9 lore raw
Quoted 42 lines · Krzysztof Kozlowski
Quoted 33 lines · Purva Yeshi
Quoted 32 lines · Krzysztof Kozlowski
Quoted 7 lines · Purva Yeshi

Convert the existing lpc32xx-pwm.txt bindings documentation into a YAML schema (nxp,lpc3220-pwm.yaml).

Set "#pwm-cells" to const: 3 for expected PWM cell properties.

---

---

<form letter>
This is an automated instruction, just in case, because many review tags are being ignored. If you know the process, you can skip it (please do not feel offended by me posting it here - no bad intentions intended). If you do not know the process, here is a short explanation:

Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply.

Full context and explanation:
https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577
</form letter>

Quoted 7 lines
Quoted 2 lines

Best regards,
Krzysztof

Hello!

I wanted to follow up on the patch I submitted. I was wondering if you had a chance to review it and if there are any comments or feedback.

Quoted 7 lines

And what did you quote? What's there? Did you read it before replying?

Please avoid pinging during the merge window.

Best regards,
Krzysztof

Hello Krzysztof,

Apologies for the unnecessary follow-up. I’ll avoid pinging during the merge window.

#10 lore raw
In reply to Purva Yeshi

Hello,

Quoted 6 lines · Purva Yeshi

Convert the existing lpc32xx-pwm.txt bindings documentation into a YAML schema (nxp,lpc3220-pwm.yaml).

Set "#pwm-cells" to const: 3 for expected PWM cell properties.

I suggest the following commit log:

dt-bindings: pwm: Convert lpc32xx-pwm.txt to yaml format

Convert the existing plain text binding documentation for nxp,lpc3220-pwm devices to a YAML schema.

The value #pwm-cells wasn't specified before, set it to 3 to match the usual value for PWMs.

Quoted 20 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +14 -0
new file mode 100644
index 000000000..432a5e9d4
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/nxp,lpc3220-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LPC32XX PWM controller
+
+maintainers:
+  - Vladimir Zapolskiy <[email protected]>
+  - Piotr Wojtaszczyk <[email protected]>
+
+allOf:
+  - $ref: pwm.yaml#

Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml line 24

Quoted 10 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +10 -0
+
+properties:
+  compatible:
+    const: nxp,lpc3220-pwm
+
+  reg:
+    maxItems: 1
+
+  "#pwm-cells":
+    const: 3

The PWMs defined in arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi also have a clocks property and in the driver it's not optional. Can you please add it (here, in the list of required properties and the commit log)?

Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml line 38

Quoted 13 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +13 -0
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    pwm@4005c000 {
+        compatible = "nxp,lpc3220-pwm";
+        reg = <0x4005c000 0x4>;
+        #pwm-cells = <3>;
+    };

Best regards
Uwe

#11 lore raw
Quoted 12 lines · Uwe Kleine-König

Hello,

Quoted 6 lines · Purva Yeshi

Convert the existing lpc32xx-pwm.txt bindings documentation into a YAML schema (nxp,lpc3220-pwm.yaml).

Set "#pwm-cells" to const: 3 for expected PWM cell properties.

I suggest the following commit log:

Quoted 8 lines

dt-bindings: pwm: Convert lpc32xx-pwm.txt to yaml format

Convert the existing plain text binding documentation for nxp,lpc3220-pwm devices to a YAML schema.

The value #pwm-cells wasn't specified before, set it to 3 to match the usual value for PWMs.

Hello,

Thank you for the suggestion. I'll update the commit log accordingly in the next revision.

Quoted 26 lines
Quoted 26 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +20 -0
new file mode 100644
index 000000000..432a5e9d4
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/nxp,lpc3220-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LPC32XX PWM controller
+
+maintainers:
+  - Vladimir Zapolskiy <[email protected]>
+  - Piotr Wojtaszczyk <[email protected]>
+
+allOf:
+  - $ref: pwm.yaml#
+
+properties:
+  compatible:
+    const: nxp,lpc3220-pwm
+
+  reg:
Quoted 8 lines

Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml line 24

Quoted 4 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +4 -0
+    maxItems: 1
+
+  "#pwm-cells":
+    const: 3

The PWMs defined in arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi also have a clocks property and in the driver it's not optional. Can you please add it (here, in the list of required properties and the commit log)?

Thank you for the review. I’ll add the clocks property, update the list of required properties, and adjust the commit log accordingly in the next revision.

Quoted 17 lines
Quoted 4 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +3 -0
+required:
+  - compatible
+  - reg

Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml line 38

Quoted 10 lines
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml new file +10 -0
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    pwm@4005c000 {
+        compatible = "nxp,lpc3220-pwm";
+        reg = <0x4005c000 0x4>;
+        #pwm-cells = <3>;
+    };

Best regards
Uwe

Best regards,
Purva Yeshi