Skip to contentSkip to conversation

dt-bindings: watchdog: da9062-wdt: convert txt to yaml

PATCH Superseded Nik Bune 2 participants 4 messages Oct 10, 2023 – Oct 17, 2023

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Nik Bune

author
#0 lore raw

PATCH v2 1/1 dt-bindings: watchdog: da9062-wdt: convert txt to yaml

Convert txt file to yaml.
Add a mainterner block. Took a value from dlg,da9063 PMIC.

---

Changes in v2:
- Updated filename to be equal to compatible value.
- Removed ">" in description fields.
- Added optional properties to the example.
- Removed reg property, as it is not present in the txt version.

 .../bindings/watchdog/da9062-wdt.txt          | 34 -------------
 .../watchdog/dlg,da9062-watchdog.yaml         | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/da9062-wdt.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml
Documentation/devicetree/bindings/watchdog/da9062-wdt.txt deleted +0 -34
deleted file mode 100644
index 354314d854ef..000000000000
@@ -1,34 +0,0 @@
-* Dialog Semiconductor DA9062/61 Watchdog Timer
-
-Required properties:
-
-- compatible: should be one of the following valid compatible string lines:
-	"dlg,da9061-watchdog", "dlg,da9062-watchdog"
-	"dlg,da9062-watchdog"
-
-Optional properties:
-- dlg,use-sw-pm: Add this property to disable the watchdog during suspend.
-	Only use this option if you can't use the watchdog automatic suspend
-	function during a suspend (see register CONTROL_B).
-- dlg,wdt-sd: Set what happens on watchdog timeout. If this bit is set the
-	watchdog timeout triggers SHUTDOWN, if cleared the watchdog triggers
-	POWERDOWN. Can be 0 or 1. Only use this option if you want to change the
-	default chip's OTP setting for WATCHDOG_SD bit. If this property is NOT
-	set the WATCHDOG_SD bit and on timeout watchdog behavior will match the
-	chip's OTP settings.
-
-Example: DA9062
-
-	pmic0: da9062@58 {
-		watchdog {
-			compatible = "dlg,da9062-watchdog";
-		};
-	};
-
-Example: DA9061 using a fall-back compatible for the DA9062 watchdog driver
-
-	pmic0: da9061@58 {
-		watchdog {
-			compatible = "dlg,da9061-watchdog", "dlg,da9062-watchdog";
-		};
-	};
Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw
Quoted 84 lines · Nik Bune

Convert txt file to yaml.
Add a mainterner block. Took a value from dlg,da9063 PMIC.

---

Changes in v2:
- Updated filename to be equal to compatible value.
- Removed ">" in description fields.
- Added optional properties to the example.
- Removed reg property, as it is not present in the txt version.

 .../bindings/watchdog/da9062-wdt.txt          | 34 -------------
 .../watchdog/dlg,da9062-watchdog.yaml         | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/da9062-wdt.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml
Documentation/devicetree/bindings/watchdog/da9062-wdt.txt deleted +0 -34
deleted file mode 100644
index 354314d854ef..000000000000
@@ -1,34 +0,0 @@
-* Dialog Semiconductor DA9062/61 Watchdog Timer
-
-Required properties:
-
-- compatible: should be one of the following valid compatible string lines:
-	"dlg,da9061-watchdog", "dlg,da9062-watchdog"
-	"dlg,da9062-watchdog"
-
-Optional properties:
-- dlg,use-sw-pm: Add this property to disable the watchdog during suspend.
-	Only use this option if you can't use the watchdog automatic suspend
-	function during a suspend (see register CONTROL_B).
-- dlg,wdt-sd: Set what happens on watchdog timeout. If this bit is set the
-	watchdog timeout triggers SHUTDOWN, if cleared the watchdog triggers
-	POWERDOWN. Can be 0 or 1. Only use this option if you want to change the
-	default chip's OTP setting for WATCHDOG_SD bit. If this property is NOT
-	set the WATCHDOG_SD bit and on timeout watchdog behavior will match the
-	chip's OTP settings.
-
-Example: DA9062
-
-	pmic0: da9062@58 {
-		watchdog {
-			compatible = "dlg,da9062-watchdog";
-		};
-	};
-
-Example: DA9061 using a fall-back compatible for the DA9062 watchdog driver
-
-	pmic0: da9061@58 {
-		watchdog {
-			compatible = "dlg,da9061-watchdog", "dlg,da9062-watchdog";
-		};
-	};
Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml new file +19 -0
new file mode 100644
index 000000000000..9b7ffdb01da0
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/dlg,da9062-watchdog.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Dialog Semiconductor DA9062/61 Watchdog Timer
+
+maintainers:
+  - Steve Twiss <[email protected]>
+
+allOf:
+  - $ref: watchdog.yaml#
+
+properties:
+  compatible:
+    enum: 
+      - dlg,da9061-watchdog
+      - dlg,da9062-watchdog

Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml new file +10 -0
+
+  dlg,use-sw-pm:
+    type: boolean
+    description:
+      Add this property to disable the watchdog during suspend.
+      Only use this option if you can't use the watchdog automatic suspend
+      function during a suspend (see register CONTROL_B).
+  
+  dlg,wdt-sd:
+    type: boolean

This property is a boolean...

Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml

Quoted 4 lines
Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml new file +4 -0
+    description:
+      Set what happens on watchdog timeout. If this bit is set the
+      watchdog timeout triggers SHUTDOWN, if cleared the watchdog triggers
+      POWERDOWN. Can be 0 or 1.

... but you say "can be 0 or 1". Does this refer to the bit value, or the property? There are no in-kernel users of this property as far as a quick grep shows so it is a bi hard to tell.

Otherwise, I'm happy with this.

Thanks,
Conor.

Quoted 20 lines

Only use this option if you want to change the

Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml new file +16 -0
+      default chip's OTP setting for WATCHDOG_SD bit. If this property is NOT
+      set the WATCHDOG_SD bit and on timeout watchdog behavior will match the
+      chip's OTP settings.
+
+required:
+  - compatible
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    watchdog {
+      compatible = "dlg,da9062-watchdog";
+      dlg,use-sw-pm;
+      dlg,wdt-sd;
+    };
Signature · 1 line
2.34.1
author
#2 lore raw
Quoted 7 lines

This property is a boolean...

Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml

Quoted 4 lines
Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml new file +4 -0
+    description:
+      Set what happens on watchdog timeout. If this bit is set the
+      watchdog timeout triggers SHUTDOWN, if cleared the watchdog triggers
+      POWERDOWN. Can be 0 or 1.
Quoted 8 lines

... but you say "can be 0 or 1". Does this refer to the bit value, or the property? There are no in-kernel users of this property as far as a quick grep shows so it is a bi hard to tell.

Otherwise, I'm happy with this.

Thanks,
Conor.

Hello, thank you for your review!

Good point.
It looks like it is related to property itself.

I checked other bindings, like https://www.kernel.org/doc/Documentation/devicetree/bindings/iio/adc/adi%2Cad7192.yaml . They have fields of type boolean with description “When this bit is set to 1”. So I put it as boolean.

I have just checked a couple more, and looks like they are mostly uint32 types with enum, when it goes about 0, 1 bit value in a description. $ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1]

I will update.

Thank you.

Reviewed-by
#3 lore raw
Quoted 21 lines · Nik Bune
Quoted 7 lines

This property is a boolean...

Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml

Quoted 4 lines
Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml new file +4 -0
+    description:
+      Set what happens on watchdog timeout. If this bit is set the
+      watchdog timeout triggers SHUTDOWN, if cleared the watchdog triggers
+      POWERDOWN. Can be 0 or 1.
Quoted 8 lines

... but you say "can be 0 or 1". Does this refer to the bit value, or the property? There are no in-kernel users of this property as far as a quick grep shows so it is a bi hard to tell.

Otherwise, I'm happy with this.

Thanks,
Conor.

Hello, thank you for your review!

Good point.
It looks like it is related to property itself.

Quoted 6 lines

I checked other bindings, like https://www.kernel.org/doc/Documentation/devicetree/bindings/iio/adc/adi%2Cad7192.yaml . They have fields of type boolean with description “When this bit is set to 1”. So I put it as boolean.

I have just checked a couple more, and looks like they are mostly uint32 types with enum, when it goes about 0, 1 bit value in a description. $ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1]

It _seems_ like the intention was for this to be an enum, now that I re-read the description, since it is being used to override the behaviour from the OTP.

With that changed

Thanks,
Conor.