dt-bindings: pwm: convert atmel pwm to json-schema
v2 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 v1:
- Name the file atmel,at91sam-pwm.yaml instead of atmel-pwm.yaml
- Removed unnecessary descriptions of the reg and #pwm-cells properties
- Remove unnecessary pwmleds node
- Remove #pwm-cells property from the list of required properties
- Add allOf including pwm.yaml
- Rename title from Atmel PWM Controller to Atmel/Microchip PWM controller
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 -------------- 2 files changed, 47 insertions(+), 35 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
PATCH v2 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 ---------------- 2 files changed, 42 insertions(+), 35 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
@@ -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 + +allOf: + - $ref: "pwm.yaml#" + +maintainers: + - Claudiu Beznea <[email protected]> + +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 + +additionalProperties: true + +examples: + - | + pwm0: pwm@f8034000 { + compatible = "atmel,at91sam9rl-pwm"; + reg = <0xf8034000 0x400>; + #pwm-cells = <3>; + };
Documentation/devicetree/bindings/pwm/atmel-pwm.txt deleted +0 -35
@@ -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>; - }; - };
Signature · 1 line
2.25.1
Quoted 18 lines · Sergiu Moga
Convert PWM binding for Atmel/Microchip SoCs to Device Tree Schema format.
Signed-off-by Sergiu Moga <[email protected]>--- .../bindings/pwm/atmel,at91sam-pwm.yaml | 42 +++++++++++++++++++ .../devicetree/bindings/pwm/atmel-pwm.txt | 35 ---------------- 2 files changed, 42 insertions(+), 35 deletions(-) create mode 100644 Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml delete mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txtDocumentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml new file +1
-0@@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml line 11
Quoted 10 lines
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml new file +10
-0+# 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 + +allOf: + - $ref: "pwm.yaml#"
allOf by convention should go between maintaners and properties.
Quoted 13 lines
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml new file +13
-0+ +maintainers: + - Claudiu Beznea <[email protected]> + +properties: + compatible: + enum: + - atmel,at91sam9rl-pwm + - atmel,sama5d3-pwm + - atmel,sama5d2-pwm + - microchip,sam9x60-pwm + + reg:
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml line 34
Quoted 10 lines
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml new file +10
-0+ maxItems: 1 + + "#pwm-cells": + const: 3 + +required: + - compatible + - reg + +additionalProperties: true
This has to be either additionalProperties:false or "unevaluatedProperties:false".
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml line 41
Quoted 7 lines
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml new file +7
-0+ +examples: + - | + pwm0: pwm@f8034000 { + compatible = "atmel,at91sam9rl-pwm"; + reg = <0xf8034000 0x400>; + #pwm-cells = <3>;
Also please change indentation to 2 or 4 spaces (like we use for all DTS examples). Four is preferred (only personally).
You also need to update the path in MAINTAINERS.
Best regards,
Krzysztof
Quoted 22 lines · Krzysztof Kozlowski
Quoted 21 lines · Sergiu Moga
Convert PWM binding for Atmel/Microchip SoCs to Device Tree Schema format.
Signed-off-by Sergiu Moga <[email protected]>--- .../bindings/pwm/atmel,at91sam-pwm.yaml | 42 +++++++++++++++++++ .../devicetree/bindings/pwm/atmel-pwm.txt | 35 ---------------- 2 files changed, 42 insertions(+), 35 deletions(-)create mode 100644
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yamldelete mode 100644Documentation/devicetree/bindings/pwm/atmel-pwm.txtDocumentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml new file +4
-0@@ -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 +---
Quoted 9 lines
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml line 11
Quoted 7 lines
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml new file +7
-0+$id: http://devicetree.org/schemas/pwm/atmel,at91sam-pwm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Atmel/Microchip PWM controller + +allOf: + - $ref: "pwm.yaml#"allOf by convention should go between maintaners and properties.
Understood.
Quoted 17 lines
Quoted 17 lines
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml new file +17
-0+ +maintainers: + - Claudiu Beznea <[email protected]> + +properties: + compatible: + enum: + - atmel,at91sam9rl-pwm + - atmel,sama5d3-pwm + - atmel,sama5d2-pwm + - microchip,sam9x60-pwm + + reg: + maxItems: 1 + + "#pwm-cells": + const: 3
Quoted 10 lines
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml line 34
Quoted 6 lines
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml new file +6
-0+ +required: + - compatible + - reg + +additionalProperties: trueThis has to be either additionalProperties:false or "unevaluatedProperties:false".
Indeed, I believe unevaluatedProperties: false would be better here. Thank you.
Quoted 10 lines
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml line 41
Quoted 7 lines
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml new file +7
-0+ +examples: + - | + pwm0: pwm@f8034000 { + compatible = "atmel,at91sam9rl-pwm"; + reg = <0xf8034000 0x400>; + #pwm-cells = <3>;Also please change indentation to 2 or 4 spaces (like we use for all DTS examples). Four is preferred (only personally).
Noted, I will change the indentation to 4 spaces.
Quoted 2 lines
You also need to update the path in
MAINTAINERS.
Noted.
Quoted 2 lines
Best regards,
Krzysztof
Thank you for the feedback.
Sergiu
PATCH v2 2/2 dt-bindings: pwm: at91: Add SAMA7G5 compatible strings list
In reply to Sergiu MogaAdd 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
@@ -15,11 +15,16 @@ maintainers: 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