Skip to contentSkip to conversation

dt-bindings: watchdog: convert faraday,ftwdt010 to yaml

PATCH Superseded Corentin Labbe 3 participants 3 messages Jan 28, 2022 – Feb 10, 2022

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: watchdog: convert faraday,ftwdt010 to yaml

Converts watchdog/faraday,ftwdt010.txt to yaml.
This permits to detect missing properties like clocks and resets or compatible like moxa,moxart-watchdog.

---
 .../bindings/watchdog/faraday,ftwdt010.txt    | 22 -------
 .../bindings/watchdog/faraday,ftwdt010.yaml   | 60 +++++++++++++++++++
 2 files changed, 60 insertions(+), 22 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml
Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.txt deleted +0 -22
deleted file mode 100644
index 9ecdb502e605..000000000000
@@ -1,22 +0,0 @@
-Faraday Technology FTWDT010 watchdog
-
-This is an IP part from Faraday Technology found in the Gemini
-SoCs and others.
-
-Required properties:
-- compatible : must be one of
-  "faraday,ftwdt010"
-  "cortina,gemini-watchdog", "faraday,ftwdt010"
-- reg : shall contain base register location and length
-- interrupts : shall contain the interrupt for the watchdog
-
-Optional properties:
-- timeout-sec : the default watchdog timeout in seconds.
-
-Example:
-
-watchdog@41000000 {
-	compatible = "faraday,ftwdt010";
-	reg = <0x41000000 0x1000>;
-	interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
-};
Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer
#2 lore raw
In reply to Corentin Labbe
Quoted 51 lines · Corentin Labbe

Converts watchdog/faraday,ftwdt010.txt to yaml.
This permits to detect missing properties like clocks and resets or compatible like moxa,moxart-watchdog.

---
 .../bindings/watchdog/faraday,ftwdt010.txt    | 22 -------
 .../bindings/watchdog/faraday,ftwdt010.yaml   | 60 +++++++++++++++++++
 2 files changed, 60 insertions(+), 22 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml
Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.txt deleted +0 -22
deleted file mode 100644
index 9ecdb502e605..000000000000
@@ -1,22 +0,0 @@
-Faraday Technology FTWDT010 watchdog
-
-This is an IP part from Faraday Technology found in the Gemini
-SoCs and others.
-
-Required properties:
-- compatible : must be one of
-  "faraday,ftwdt010"
-  "cortina,gemini-watchdog", "faraday,ftwdt010"
-- reg : shall contain base register location and length
-- interrupts : shall contain the interrupt for the watchdog
-
-Optional properties:
-- timeout-sec : the default watchdog timeout in seconds.
-
-Example:
-
-watchdog@41000000 {
-	compatible = "faraday,ftwdt010";
-	reg = <0x41000000 0x1000>;
-	interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
-};
Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml new file +5 -0
new file mode 100644
index 000000000000..377529b21267
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/faraday,ftwdt010.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml line 15

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml new file +10 -0
+
+title: Faraday Technology FTWDT010 watchdog
+
+maintainers:
+  - Linus Walleij <[email protected]>
+
+description: |
+  This is an IP part from Faraday Technology found in the Gemini
+  SoCs and others.
+

Need a $ref to watchdog.yaml

Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml line 25

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml new file +10 -0
+properties:
+  compatible:
+    oneOf:
+      - const: "faraday,ftwdt010"
+      - items:
+          - const: "cortina,gemini-watchdog"
+          - const: "faraday,ftwdt010"
+      - items:
+          - const: "moxa,moxart-watchdog"
+          - const: "faraday,ftwdt010"

Don't need quotes

blank line

Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml line 27

Quoted 2 lines
Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml new file +2 -0
+  reg:
+    maxItems: 1

blank line...

Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml line 37

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml new file +10 -0
+  resets:
+    maxItems: 1
+  clocks:
+    maxItems: 1
+  clock-names:
+    const: PCLK
+  interrupts:
+    maxItems: 1
+  timeout-sec:
+    description: the default watchdog timeout in seconds.

Don't need to describe common properties.

Quoted 27 lines
Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml new file +23 -0
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    watchdog@41000000 {
+      compatible = "faraday,ftwdt010";
+      reg = <0x41000000 0x1000>;
+      interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+    };
+  - |
+    watchdog: watchdog@98500000 {
+      compatible = "moxa,moxart-watchdog", "faraday,ftwdt010";
+      reg = <0x98500000 0x10>;
+      clocks = <&clk_apb>;
+      clock-names = "PCLK";
+    };
+...
Signature · 1 line
2.34.1