Skip to contentSkip to conversation

dt-bindings: pwm: convert atmel pwm to json-schema

PATCH Applied Sergiu Moga 4 participants 7 messages Mar 7, 2022 – Apr 22, 2022

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

v3 cover dt-bindings: pwm: convert atmel pwm to json-schema

This patch series addresses the conversion of the Atmel PWM DT binding to the DT Schema format and adds the SAMA7G5 compatible to the respective converted binding.

Changes since v2:
- Moved allOf between maintainers and properties`
- Replaced additionalProperties: true with unevaluatedProperties: false
- Used 4 spaces indentation for examples
- Modified file path in MAINTAINERS

Sergiu Moga (2):
dt-bindings: pwm: convert atmel pwm to json-schema
dt-bindings: pwm: at91: Add SAMA7G5 compatible strings list

 .../bindings/pwm/atmel,at91sam-pwm.yaml       | 47 +++++++++++++++++++
 .../devicetree/bindings/pwm/atmel-pwm.txt     | 35 --------------
 MAINTAINERS                                   |  2 +-
 3 files changed, 48 insertions(+), 36 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
 delete mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt
Signature · 1 line
2.25.1
#1 lore raw

PATCH v3 1/2 dt-bindings: pwm: convert atmel pwm to json-schema

Convert PWM binding for Atmel/Microchip SoCs to Device Tree Schema format.

---
 .../bindings/pwm/atmel,at91sam-pwm.yaml       | 42 +++++++++++++++++++
 .../devicetree/bindings/pwm/atmel-pwm.txt     | 35 ----------------
 MAINTAINERS                                   |  2 +-
 3 files changed, 43 insertions(+), 36 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
 delete mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml new file +42 -0
new file mode 100644
index 000000000000..5e8bb5a8095d
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/atmel,at91sam-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel/Microchip PWM controller
+
+maintainers:
+  - Claudiu Beznea <[email protected]>
+
+allOf:
+  - $ref: "pwm.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - atmel,at91sam9rl-pwm
+      - atmel,sama5d3-pwm
+      - atmel,sama5d2-pwm
+      - microchip,sam9x60-pwm
+
+  reg:
+    maxItems: 1
+
+  "#pwm-cells":
+    const: 3
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    pwm0: pwm@f8034000 {
+        compatible = "atmel,at91sam9rl-pwm";
+        reg = <0xf8034000 0x400>;
+        #pwm-cells = <3>;
+    };
Documentation/devicetree/bindings/pwm/atmel-pwm.txt deleted +0 -35
deleted file mode 100644
index fbb5325be1f0..000000000000
@@ -1,35 +0,0 @@
-Atmel PWM controller
-
-Required properties:
-  - compatible: should be one of:
-    - "atmel,at91sam9rl-pwm"
-    - "atmel,sama5d3-pwm"
-    - "atmel,sama5d2-pwm"
-    - "microchip,sam9x60-pwm"
-  - reg: physical base address and length of the controller's registers
-  - #pwm-cells: Should be 3. See pwm.yaml in this directory for a
-    description of the cells format.
-
-Example:
-
-	pwm0: pwm@f8034000 {
-		compatible = "atmel,at91sam9rl-pwm";
-		reg = <0xf8034000 0x400>;
-		#pwm-cells = <3>;
-	};
-
-	pwmleds {
-		compatible = "pwm-leds";
-
-		d1 {
-			label = "d1";
-			pwms = <&pwm0 3 5000 0>
-			max-brightness = <255>;
-		};
-
-		d2 {
-			label = "d2";
-			pwms = <&pwm0 1 5000 1>
-			max-brightness = <255>;
-		};
-	};
MAINTAINERS +1 -1
index a35eef379db0..f8b27ac0572d 100644
@@ -12903,7 +12903,7 @@ M:	Claudiu Beznea <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
 L:	[email protected]
 S:	Supported
-F:	Documentation/devicetree/bindings/pwm/atmel-pwm.txt
+F:	Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
 F:	drivers/pwm/pwm-atmel.c
 
 MICROCHIP SAMA5D2-COMPATIBLE ADC DRIVER
Signature · 1 line
2.25.1
Reviewed-by on v3 1/2
#2 lore raw
Quoted 12 lines · Sergiu Moga

Convert PWM binding for Atmel/Microchip SoCs to Device Tree Schema format.

---
 .../bindings/pwm/atmel,at91sam-pwm.yaml       | 42 +++++++++++++++++++
 .../devicetree/bindings/pwm/atmel-pwm.txt     | 35 ----------------
 MAINTAINERS                                   |  2 +-
 3 files changed, 43 insertions(+), 36 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
 delete mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt

Best regards,
Krzysztof

maintainer
#3 lore raw
In reply to Sergiu Moga
Quoted 12 lines · Sergiu Moga

Convert PWM binding for Atmel/Microchip SoCs to Device Tree Schema format.

---
 .../bindings/pwm/atmel,at91sam-pwm.yaml       | 42 +++++++++++++++++++
 .../devicetree/bindings/pwm/atmel-pwm.txt     | 35 ----------------
 MAINTAINERS                                   |  2 +-
 3 files changed, 43 insertions(+), 36 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
 delete mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt

Running 'make dtbs_check' with the schema in this patch gives the following warnings. Consider if they are expected or the schema is incorrect. These may not be new warnings.

Note that it is not yet a requirement to have 0 warnings for dtbs_check. This will change in the future.

Full log is available here: https://patchwork.ozlabs.org/patch/1602300

pwm@e1604000: compatible:0: 'microchip,sama7g5-pwm' is not one of ['atmel,at91sam9rl-pwm', 'atmel,sama5d3-pwm', 'atmel,sama5d2-pwm', 'microchip,sam9x60-pwm']

	arch/arm/boot/dts/at91-sama7g5ek.dt.yaml

pwm@e1604000: compatible: ['microchip,sama7g5-pwm', 'atmel,sama5d2-pwm'] is too long

	arch/arm/boot/dts/at91-sama7g5ek.dt.yaml
maintainer
#4 lore raw
Quoted 21 lines · Rob Herring
Quoted 12 lines · Sergiu Moga

Convert PWM binding for Atmel/Microchip SoCs to Device Tree Schema format.

---
 .../bindings/pwm/atmel,at91sam-pwm.yaml       | 42 +++++++++++++++++++
 .../devicetree/bindings/pwm/atmel-pwm.txt     | 35 ----------------
 MAINTAINERS                                   |  2 +-
 3 files changed, 43 insertions(+), 36 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
 delete mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt

Running 'make dtbs_check' with the schema in this patch gives the following warnings. Consider if they are expected or the schema is incorrect. These may not be new warnings.

Note that it is not yet a requirement to have 0 warnings for dtbs_check. This will change in the future.

Quoted 8 lines

Full log is available here: https://patchwork.ozlabs.org/patch/1602300

pwm@e1604000: compatible:0: 'microchip,sama7g5-pwm' is not one of ['atmel,at91sam9rl-pwm', 'atmel,sama5d3-pwm', 'atmel,sama5d2-pwm', 'microchip,sam9x60-pwm']

	arch/arm/boot/dts/at91-sama7g5ek.dt.yaml

pwm@e1604000: compatible: ['microchip,sama7g5-pwm', 'atmel,sama5d2-pwm'] is too long

	arch/arm/boot/dts/at91-sama7g5ek.dt.yaml

Disregard, I see patch 2 addresses this.

Rob

#5 lore raw

PATCH v3 2/2 dt-bindings: pwm: at91: Add SAMA7G5 compatible strings list

In reply to Sergiu Moga

Add compatible strings list for SAMA7G5.

---
 .../bindings/pwm/atmel,at91sam-pwm.yaml           | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml +10 -5
index 5e8bb5a8095d..ab45df80345d 100644
@@ -15,11 +15,16 @@ allOf:
 
 properties:
   compatible:
-    enum:
-      - atmel,at91sam9rl-pwm
-      - atmel,sama5d3-pwm
-      - atmel,sama5d2-pwm
-      - microchip,sam9x60-pwm
+    oneOf:
+      - items:
+          - enum:
+              - atmel,at91sam9rl-pwm
+              - atmel,sama5d3-pwm
+              - atmel,sama5d2-pwm
+              - microchip,sam9x60-pwm
+      - items:
+          - const: microchip,sama7g5-pwm
+          - const: atmel,sama5d2-pwm
 
   reg:
     maxItems: 1
Signature · 1 line
2.25.1
#6 lore raw
In reply to Sergiu Moga
Quoted 15 lines · Sergiu Moga

This patch series addresses the conversion of the Atmel PWM DT binding to the DT Schema format and adds the SAMA7G5 compatible to the respective converted binding.

Changes since v2:
- Moved allOf between maintainers and properties`
- Replaced additionalProperties: true with unevaluatedProperties: false
- Used 4 spaces indentation for examples
- Modified file path in MAINTAINERS

Sergiu Moga (2):
dt-bindings: pwm: convert atmel pwm to json-schema
dt-bindings: pwm: at91: Add SAMA7G5 compatible strings list

Quoted 6 lines
 .../bindings/pwm/atmel,at91sam-pwm.yaml       | 47 +++++++++++++++++++
 .../devicetree/bindings/pwm/atmel-pwm.txt     | 35 --------------
 MAINTAINERS                                   |  2 +-
 3 files changed, 48 insertions(+), 36 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
 delete mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt

Applied, thanks.

Thierry