Skip to contentSkip to conversation

dt-bindings: regulator: Convert sy8824x to json-schema

PATCH Superseded Jisheng Zhang 2 participants 2 messages Jul 29, 2020 – Jul 31, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dt-bindings: regulator: Convert sy8824x to json-schema

From: Jisheng Zhang <[email protected]>

Convert the sy8824x binding to DT schema format using json-schema.

---

Since v1
-It seems there's something wrong with my last email, so send out a v2 with
another email account

 .../bindings/regulator/silergy,sy8824x.yaml   | 40 +++++++++++++++++++
 .../devicetree/bindings/regulator/sy8824x.txt | 24 -----------
 2 files changed, 40 insertions(+), 24 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/silergy,sy8824x.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/sy8824x.txt
Documentation/devicetree/bindings/regulator/silergy,sy8824x.yaml new file +40 -0
new file mode 100644
index 000000000000..62a476c94111
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/silergy,sy8824x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: silergy sy8824c,sy8824e,sy20276 and sy20278 PMIC
+
+maintainers:
+  - Jisheng Zhang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - silergy,sy8824c
+      - silergy,sy8824e
+      - silergy,sy20276
+      - silergy,sy20278
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        regulator@60 {
+          compatible = "silergy,sy8824c";
+          regulator-min-microvolt = <800000>;
+          regulator-max-microvolt = <1150000>;
+          reg = <0x60>;
+        };
+    };
+
+...
Documentation/devicetree/bindings/regulator/sy8824x.txt deleted +0 -24
deleted file mode 100644
index c5e95850c427..000000000000
@@ -1,24 +0,0 @@
-SY8824C/SY8824E/SY20276 Voltage regulator
-
-Required properties:
-- compatible: Must be one of the following.
-	"silergy,sy8824c"
-	"silergy,sy8824e"
-	"silergy,sy20276"
-	"silergy,sy20278"
-- reg: I2C slave address
-
-Any property defined as part of the core regulator binding, defined in
-./regulator.txt, can also be used.
-
-Example:
-
-	vcore: regulator@00 {
-		compatible = "silergy,sy8824c";
-		reg = <0x66>;
-		regulator-name = "vcore";
-		regulator-min-microvolt = <800000>;
-		regulator-max-microvolt = <1150000>;
-		regulator-boot-on;
-		regulator-always-on;
-	};
Signature · 1 line
2.28.0.rc0
maintainer
#1 lore raw
Quoted 38 lines · Jisheng Zhang

From: Jisheng Zhang <[email protected]>

Convert the sy8824x binding to DT schema format using json-schema.

---

Since v1
-It seems there's something wrong with my last email, so send out a v2 with
another email account

 .../bindings/regulator/silergy,sy8824x.yaml   | 40 +++++++++++++++++++
 .../devicetree/bindings/regulator/sy8824x.txt | 24 -----------
 2 files changed, 40 insertions(+), 24 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/silergy,sy8824x.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/sy8824x.txt
Documentation/devicetree/bindings/regulator/silergy,sy8824x.yaml new file +15 -0
new file mode 100644
index 000000000000..62a476c94111
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/silergy,sy8824x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: silergy sy8824c,sy8824e,sy20276 and sy20278 PMIC
+
+maintainers:
+  - Jisheng Zhang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - silergy,sy8824c

Documentation/devicetree/bindings/regulator/silergy,sy8824x.yaml line 25

Quoted 10 lines
Documentation/devicetree/bindings/regulator/silergy,sy8824x.yaml new file +10 -0
+      - silergy,sy8824e
+      - silergy,sy20276
+      - silergy,sy20278
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg

Needs a $ref to regulator.yaml and then:

unevaluatedProperties: false

Quoted 49 lines
Documentation/devicetree/bindings/regulator/silergy,sy8824x.yaml new file +15 -0
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        regulator@60 {
+          compatible = "silergy,sy8824c";
+          regulator-min-microvolt = <800000>;
+          regulator-max-microvolt = <1150000>;
+          reg = <0x60>;
+        };
+    };
+
+...
Documentation/devicetree/bindings/regulator/sy8824x.txt deleted +0 -24
deleted file mode 100644
index c5e95850c427..000000000000
@@ -1,24 +0,0 @@
-SY8824C/SY8824E/SY20276 Voltage regulator
-
-Required properties:
-- compatible: Must be one of the following.
-	"silergy,sy8824c"
-	"silergy,sy8824e"
-	"silergy,sy20276"
-	"silergy,sy20278"
-- reg: I2C slave address
-
-Any property defined as part of the core regulator binding, defined in
-./regulator.txt, can also be used.
-
-Example:
-
-	vcore: regulator@00 {
-		compatible = "silergy,sy8824c";
-		reg = <0x66>;
-		regulator-name = "vcore";
-		regulator-min-microvolt = <800000>;
-		regulator-max-microvolt = <1150000>;
-		regulator-boot-on;
-		regulator-always-on;
-	};
Signature · 1 line
2.28.0.rc0