Skip to contentSkip to conversation

dt-bindings: rtc: pcf8523: Convert to YAML

PATCH Superseded Fabio Estevam 3 participants 3 messages Sep 5, 2023

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dt-bindings: rtc: pcf8523: Convert to YAML

From: Fabio Estevam <[email protected]>

Convert the PCF8523 bindings from text format to YAML.

The YAML format is preferred as it allows validation.

---
Changes since v1:
- Add the default value for quartz-load-femtofarads. (Krzysztof)
- Pass unevaluatedProperties: false. (Krzysztof)
- Fixed a typo on Sam's email address.

 .../devicetree/bindings/rtc/nxp,pcf8523.txt   | 18 --------
 .../devicetree/bindings/rtc/nxp,pcf8523.yaml  | 45 +++++++++++++++++++
 2 files changed, 45 insertions(+), 18 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/nxp,pcf8523.yaml
Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt deleted +0 -18
deleted file mode 100644
index 0b1080c60f63..000000000000
@@ -1,18 +0,0 @@
-* NXP PCF8523 Real Time Clock
-
-Required properties:
-- compatible: Should contain "nxp,pcf8523".
-- reg: I2C address for chip.
-
-Optional property:
-- quartz-load-femtofarads: The capacitive load of the quartz(x-tal),
-  expressed in femto Farad (fF). Valid values are 7000 and 12500.
-  Default value (if no value is specified) is 12500fF.
-
-Example:
-
-pcf8523: rtc@68 {
-	compatible = "nxp,pcf8523";
-	reg = <0x68>;
-	quartz-load-femtofarads = <7000>;
-};
Documentation/devicetree/bindings/rtc/nxp,pcf8523.yaml new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw

Hi Fabio,

Quoted 65 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Convert the PCF8523 bindings from text format to YAML.

The YAML format is preferred as it allows validation.

---
Changes since v1:
- Add the default value for quartz-load-femtofarads. (Krzysztof)
- Pass unevaluatedProperties: false. (Krzysztof)
- Fixed a typo on Sam's email address.

 .../devicetree/bindings/rtc/nxp,pcf8523.txt   | 18 --------
 .../devicetree/bindings/rtc/nxp,pcf8523.yaml  | 45 +++++++++++++++++++
 2 files changed, 45 insertions(+), 18 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/nxp,pcf8523.yaml
Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt deleted +0 -18
deleted file mode 100644
index 0b1080c60f63..000000000000
@@ -1,18 +0,0 @@
-* NXP PCF8523 Real Time Clock
-
-Required properties:
-- compatible: Should contain "nxp,pcf8523".
-- reg: I2C address for chip.
-
-Optional property:
-- quartz-load-femtofarads: The capacitive load of the quartz(x-tal),
-  expressed in femto Farad (fF). Valid values are 7000 and 12500.
-  Default value (if no value is specified) is 12500fF.
-
-Example:
-
-pcf8523: rtc@68 {
-	compatible = "nxp,pcf8523";
-	reg = <0x68>;
-	quartz-load-femtofarads = <7000>;
-};
Documentation/devicetree/bindings/rtc/nxp,pcf8523.yaml new file +16 -0
new file mode 100644
index 000000000000..8d17b89fef5e
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/nxp,pcf8523.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP PCF8523 Real Time Clock
+
+maintainers:
+  - Sam Ravnborg <[email protected]>
+
+allOf:
+  - $ref: rtc.yaml#
+
+properties:
+  compatible:

Documentation/devicetree/bindings/rtc/nxp,pcf8523.yaml line 26

Quoted 10 lines
Documentation/devicetree/bindings/rtc/nxp,pcf8523.yaml new file +10 -0
+    const: nxp,pcf8523
+
+  reg:
+    maxItems: 1
+
+  quartz-load-femtofarads:
+    description:
+      The capacitive load of the crystal, expressed in femto Farad (fF).
+    enum: [ 7000, 12500 ]
+    default: 7000

isn't the default value 12500 anymore? it used to be and the driver still uses 12500fF as the default value.

Quoted 9 lines
Documentation/devicetree/bindings/rtc/nxp,pcf8523.yaml new file +9 -0
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |

Documentation/devicetree/bindings/rtc/nxp,pcf8523.yaml line 45

Quoted 10 lines
Documentation/devicetree/bindings/rtc/nxp,pcf8523.yaml new file +10 -0
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        rtc@68 {
+            compatible = "nxp,pcf8523";
+            reg = <0x68>;
+            quartz-load-femtofarads = <7000>;
+        };
+    };

Best regards,
Javier Carrasco

#2 lore raw

Hi Javier,

Quoted 2 lines · Javier Carrasco

isn't the default value 12500 anymore? it used to be and the driver still uses 12500fF as the default value.

You are right.

I will fix it in v3.

Thanks,

Fabio Estevam