Skip to contentSkip to conversation

dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml

PATCH Superseded Tony Lindgren 2 participants 7 messages Nov 18, 2022 – Nov 21, 2022

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml

Update for yaml and remove the old txt binding.

Cc Nishanth Menon <[email protected]>
Cc Vignesh Raghavendra <[email protected]>
---
 .../bindings/pwm/pwm-omap-dmtimer.txt         | 22 --------
 .../bindings/pwm/ti,pwm-omap-dmtimer.yaml     | 56 +++++++++++++++++++
 2 files changed, 56 insertions(+), 22 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml
Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt deleted +0 -22
deleted file mode 100644
@@ -1,22 +0,0 @@
-* OMAP PWM for dual-mode timers
-
-Required properties:
-- compatible: Shall contain "ti,omap-dmtimer-pwm".
-- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer-dm.yaml for info
-  about these timers.
-- #pwm-cells: Should be 3. See pwm.yaml in this directory for a description of
-  the cells format.
-
-Optional properties:
-- ti,prescaler: Should be a value between 0 and 7, see the timers datasheet
-- ti,clock-source: Set dmtimer parent clock, values between 0 and 2:
-  - 0x00 - high-frequency system clock (timer_sys_ck)
-  - 0x01 - 32-kHz always-on clock (timer_32k_ck)
-  - 0x02 - external clock (timer_ext_ck, OMAP2 only)
-
-Example:
-	pwm9: dmtimer-pwm@9 {
-		compatible = "ti,omap-dmtimer-pwm";
-		ti,timers = <&timer9>;
-		#pwm-cells = <3>;
-	};
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
2.38.1
#1 lore raw
Quoted 5 lines · Tony Lindgren

Update for yaml and remove the old txt binding.

Cc Nishanth Menon <[email protected]>
Cc Vignesh Raghavendra <[email protected]>

Thank you for your patch. There is something to discuss/improve.

Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml

Quoted 10 lines
Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt deleted +0 -6
-Example:
-	pwm9: dmtimer-pwm@9 {
-		compatible = "ti,omap-dmtimer-pwm";
-		ti,timers = <&timer9>;
-		#pwm-cells = <3>;
-	};
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +0 -0
new file mode 100644

Use filename matching the compatible, so ti,omap-dmtimer-pwm.yaml

Quoted 11 lines
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +10 -0
@@ -0,0 +1,56 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/ti,pwm-omap-dmtimer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI dual mode timer PWM controller
+
+maintainers:
+  - Tony Lindgren <[email protected]>

Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml line 20

Quoted 10 lines
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +10 -0
+
+description:
+  TI dual mode timer instances have an IO pin for PWM capability
+
+allOf:
+  - $ref: pwm.yaml#
+
+properties:
+  $nodename:
+    pattern: "^pwm-([1-9]|1[0-2])$"

Drop the nodename, device schemas do not need to enforce it.

Quoted 6 lines
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +6 -0
+
+  compatible:
+    const: ti,omap-dmtimer-pwm
+
+  "#pwm-cells":
+    const: 3

Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml line 36

Quoted 10 lines
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +10 -0
+
+  ti,timers:
+    description: phandle to the timer instance used for PWM
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+  ti,prescaler:
+    description: legacy clock prescaled for timer
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
+    deprecated: true

This was not deprecated before and your commit msg does not mention it.

Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml line 41

Quoted 5 lines
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +5 -0
+
+  ti,clock-source:
+    description: legacy clock for timer, use assigned-clocks instead
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 0, 1, 2 ]

You miss here explanation of constants.

Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml line 42

Quoted 1 line
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +1 -0
+    deprecated: true

This was not deprecated before and your commit msg does not mention it.

Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml line 52

Quoted 10 lines
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +10 -0
+
+required:
+  - compatible
+  - ti,timers
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    pwm9: pwm-9 {

Node name: pwm

Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml line 56

Quoted 4 lines
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +4 -0
+      compatible = "ti,omap-dmtimer-pwm";
+      ti,timers = <&timer9>;
+      #pwm-cells = <3>;
+    };

Best regards,
Krzysztof

#2 lore raw
Quoted 6 lines · Krzysztof Kozlowski

Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml line 20

Quoted 3 lines · Tony Lindgren
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +3 -0
+properties:
+  $nodename:
+    pattern: "^pwm-([1-9]|1[0-2])$"

Drop the nodename, device schemas do not need to enforce it.

Hmm I think that's needed to avoid warnings if the knob is tweaked to 11? Right now the max timer value is 12.

Quoted 7 lines

Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml line 36

Quoted 5 lines
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +5 -0
+  ti,prescaler:
+    description: legacy clock prescaled for timer
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
+    deprecated: true

This was not deprecated before and your commit msg does not mention it.

OK will add and fix up the other things you noticed too.

Thanks,

Tony

#3 lore raw
Quoted 10 lines · Tony Lindgren
Quoted 6 lines · Krzysztof Kozlowski

Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml line 20

Quoted 3 lines · Tony Lindgren
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +3 -0
+properties:
+  $nodename:
+    pattern: "^pwm-([1-9]|1[0-2])$"

Drop the nodename, device schemas do not need to enforce it.

Hmm I think that's needed to avoid warnings if the knob is tweaked to 11? Right now the max timer value is 12.

Which warnings? The pwm.yaml allows up to 15.

Best regards,
Krzysztof

#4 lore raw
Quoted 7 lines · Krzysztof Kozlowski
Quoted 6 lines · Tony Lindgren
Quoted 5 lines · Krzysztof Kozlowski
Quoted 3 lines · Tony Lindgren
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +3 -0
+properties:
+  $nodename:
+    pattern: "^pwm-([1-9]|1[0-2])$"
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Drop the nodename, device schemas do not need to enforce it.

Hmm I think that's needed to avoid warnings if the knob is tweaked to 11? Right now the max timer value is 12.

Which warnings? The pwm.yaml allows up to 15.

Heh I was using dec instead of hex.. :) Yup pwm.yaml works just fine.

Regards,

Tony

#5 lore raw
Quoted 8 lines · Tony Lindgren
Quoted 7 lines · Krzysztof Kozlowski
Quoted 6 lines · Tony Lindgren
Quoted 5 lines · Krzysztof Kozlowski
Quoted 3 lines · Tony Lindgren
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +3 -0
+properties:
+  $nodename:
+    pattern: "^pwm-([1-9]|1[0-2])$"
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Drop the nodename, device schemas do not need to enforce it.

Hmm I think that's needed to avoid warnings if the knob is tweaked to 11? Right now the max timer value is 12.

Which warnings? The pwm.yaml allows up to 15.

Heh I was using dec instead of hex.. :) Yup pwm.yaml works just fine.

This could be fixed (extended) in pwm.yaml as well, because simple human-readable increments/IDs are usually decimal. hex is only for addresses.

Best regards,
Krzysztof

#6 lore raw
Quoted 14 lines · Krzysztof Kozlowski
Quoted 13 lines · Tony Lindgren
Quoted 12 lines · Krzysztof Kozlowski
Quoted 10 lines · Tony Lindgren
Quoted 6 lines · Krzysztof Kozlowski

Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml line 20

Quoted 3 lines · Tony Lindgren
Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml new file +3 -0
+properties:
+  $nodename:
+    pattern: "^pwm-([1-9]|1[0-2])$"

Drop the nodename, device schemas do not need to enforce it.

Hmm I think that's needed to avoid warnings if the knob is tweaked to 11? Right now the max timer value is 12.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Which warnings? The pwm.yaml allows up to 15.

Heh I was using dec instead of hex.. :) Yup pwm.yaml works just fine.

This could be fixed (extended) in pwm.yaml as well, because simple human-readable increments/IDs are usually decimal. hex is only for addresses.

OK I'll do a patch for that.

Regards,

Tony

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel