Skip to contentSkip to conversation

dt-bindings: watchdog: lantiq,wdt: convert bindings to dtschema

PATCH Superseded Aleksander Jan Bajkowski 2 participants 2 messages Oct 18, 2025

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dt-bindings: watchdog: lantiq,wdt: convert bindings to dtschema

Convert the Lantiq WDT Watchdog bindings to yaml format.

---
v2:
- requirement of lantiq,rcu is now expressed as a schema

---
 .../bindings/watchdog/lantiq,wdt.yaml         | 63 +++++++++++++++++++
 .../bindings/watchdog/lantiq-wdt.txt          | 24 -------
 2 files changed, 63 insertions(+), 24 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml
 delete mode 100644 Documentation/devicetree/bindings/watchdog/lantiq-wdt.txt
Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml new file +63 -0
new file mode 100644
index 000000000000..204e16be2a79
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/lantiq,wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lantiq WTD watchdog
+
+maintainers:
+  - Hauke Mehrtens <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - lantiq,falcon-wdt
+          - lantiq,wdt
+          - lantiq,xrx100-wdt
+      - items:
+          - enum:
+              - lantiq,xrx200-wdt
+              - lantiq,xrx300-wdt
+          - const: lantiq,xrx100-wdt
+
+  reg:
+    maxItems: 1
+
+  lantiq,rcu:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: Phandle to the RCU syscon node
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: lantiq,xrx100-wdt
+    then:
+      required:
+        - lantiq,rcu
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: lantiq,falcon-wdt
+    then:
+      required:
+        - lantiq,rcu
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    watchdog@803f0 {
+        compatible = "lantiq,xrx200-wdt", "lantiq,xrx100-wdt";
+        reg = <0x803f0 0x10>;
+
+        lantiq,rcu = <&rcu0>;
+    };
Documentation/devicetree/bindings/watchdog/lantiq-wdt.txt deleted +0 -24
deleted file mode 100644
index 18d4d8302702..000000000000
@@ -1,24 +0,0 @@
-Lantiq WTD watchdog binding
-============================
-
-This describes the binding of the Lantiq watchdog driver.
-
--------------------------------------------------------------------------------
-Required properties:
-- compatible		: Should be one of
-				"lantiq,wdt"
-				"lantiq,xrx100-wdt"
-				"lantiq,xrx200-wdt", "lantiq,xrx100-wdt"
-				"lantiq,falcon-wdt"
-- reg			: Address of the watchdog block
-- lantiq,rcu		: A phandle to the RCU syscon (required for
-			  "lantiq,falcon-wdt" and "lantiq,xrx100-wdt")
-
--------------------------------------------------------------------------------
-Example for the watchdog on the xRX200 SoCs:
-		watchdog@803f0 {
-			compatible = "lantiq,xrx200-wdt", "lantiq,xrx100-wdt";
-			reg = <0x803f0 0x10>;
-
-			lantiq,rcu = <&rcu0>;
-		};
Signature · 1 line
2.47.3
#1 lore raw
Quoted 31 lines · Aleksander Jan Bajkowski

Convert the Lantiq WDT Watchdog bindings to yaml format.

---
v2:
- requirement of lantiq,rcu is now expressed as a schema

---
 .../bindings/watchdog/lantiq,wdt.yaml         | 63 +++++++++++++++++++
 .../bindings/watchdog/lantiq-wdt.txt          | 24 -------
 2 files changed, 63 insertions(+), 24 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml
 delete mode 100644 Documentation/devicetree/bindings/watchdog/lantiq-wdt.txt
Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml new file +12 -0
new file mode 100644
index 000000000000..204e16be2a79
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/lantiq,wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lantiq WTD watchdog
+
+maintainers:
+  - Hauke Mehrtens <[email protected]>
+
+properties:

Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml line 22

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml new file +10 -0
+  compatible:
+    oneOf:
+      - enum:
+          - lantiq,falcon-wdt
+          - lantiq,wdt
+          - lantiq,xrx100-wdt
+      - items:
+          - enum:
+              - lantiq,xrx200-wdt
+              - lantiq,xrx300-wdt

This wasn't in the old binding. Any change from pure conversion has to be explained WHY in the commit msg.

What is more - it does not exist. You cannot just stuff here new compatibles and call it "conversion". Conversion from dev/null into new compatible?

Quoted 17 lines
Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml new file +17 -0
+          - const: lantiq,xrx100-wdt
+
+  reg:
+    maxItems: 1
+
+  lantiq,rcu:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: Phandle to the RCU syscon node
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - if:
+      properties:
+        compatible:

Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml line 49

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml new file +10 -0
+          contains:
+            const: lantiq,xrx100-wdt
+    then:
+      required:
+        - lantiq,rcu
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: lantiq,falcon-wdt

That's just enum in previous contains.

Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml line 44

Quoted 3 lines
Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml new file +3 -0
+    then:
+      required:
+        - lantiq,rcu

Missing ref to watchdog. Otherwise why do you have unevaluatedProperties?

Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml line 54

Quoted 2 lines
Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml new file +2 -0
+
+unevaluatedProperties: false

Best regards,
Krzysztof