public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Lee Jones <lee.jones@linaro.org>, Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/6] dt-bindings: regulator: tps62360: Convert to json-schema
Date: Fri, 17 Dec 2021 18:05:05 +0100	[thread overview]
Message-ID: <20211217170507.2843568-4-thierry.reding@gmail.com> (raw)
In-Reply-To: <20211217170507.2843568-1-thierry.reding@gmail.com>

From: Thierry Reding <treding@nvidia.com>

Convert the Texas Instruments TPS62360 bindings from the free-form text
format to json-schema.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../bindings/regulator/ti,tps62360.yaml       | 80 +++++++++++++++++++
 .../bindings/regulator/tps62360-regulator.txt | 44 ----------
 2 files changed, 80 insertions(+), 44 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/ti,tps62360.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/tps62360-regulator.txt

diff --git a/Documentation/devicetree/bindings/regulator/ti,tps62360.yaml b/Documentation/devicetree/bindings/regulator/ti,tps62360.yaml
new file mode 100644
index 000000000000..82558118284d
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/ti,tps62360.yaml
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/ti,tps62360.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments TPS62360 voltage regulator
+
+maintainers:
+  - Mark Brown <broonie@kernel.org>
+
+properties:
+  compatible:
+    enum:
+      - ti,tps62360
+      - ti,tps62361
+      - ti,tps62362
+      - ti,tps62363
+
+  reg:
+    maxItems: 1
+
+  ti,enable-vout-discharge:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enable output discharge.
+
+  ti,enable-pull-down:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enable pull down.
+
+  ti,vsel0-gpio:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description: GPIO for controlling VSEL0 line. If this property is missing, then assume that
+      there is no GPIO for VSEL0 control.
+
+  ti,vsel1-gpio:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description: GPIO for controlling VSEL1 line. If this property is missing, then assume that
+      there is no GPIO for VSEL1 control.
+
+  ti,vsel0-state-high:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Initial state of VSEL0 input is high. If this property is missing, then assume
+      the state as low (0).
+
+  ti,vsel1-state-high:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Initial state of VSEL1 input is high. If this property is missing, then assume
+      the state as low (0).
+
+allOf:
+  - $ref: regulator.yaml
+
+unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      regulator@60 {
+        compatible = "ti,tps62361";
+        reg = <0x60>;
+        regulator-name = "tps62361-vout";
+        regulator-min-microvolt = <500000>;
+        regulator-max-microvolt = <1500000>;
+        regulator-boot-on;
+        ti,vsel0-gpio = <&gpio1 16 0>;
+        ti,vsel1-gpio = <&gpio1 17 0>;
+        ti,vsel0-state-high;
+        ti,vsel1-state-high;
+        ti,enable-pull-down;
+        ti,enable-vout-discharge;
+      };
+    };
diff --git a/Documentation/devicetree/bindings/regulator/tps62360-regulator.txt b/Documentation/devicetree/bindings/regulator/tps62360-regulator.txt
deleted file mode 100644
index 1b20c3dbcdb8..000000000000
--- a/Documentation/devicetree/bindings/regulator/tps62360-regulator.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-TPS62360 Voltage regulators
-
-Required properties:
-- compatible: Must be one of the following.
-	"ti,tps62360"
-	"ti,tps62361",
-	"ti,tps62362",
-	"ti,tps62363",
-- reg: I2C slave address
-
-Optional properties:
-- ti,enable-vout-discharge: Enable output discharge. This is boolean value.
-- ti,enable-pull-down: Enable pull down. This is boolean value.
-- ti,vsel0-gpio: GPIO for controlling VSEL0 line.
-  If this property is missing, then assume that there is no GPIO
-  for vsel0 control.
-- ti,vsel1-gpio: Gpio for controlling VSEL1 line.
-  If this property is missing, then assume that there is no GPIO
-  for vsel1 control.
-- ti,vsel0-state-high: Initial state of vsel0 input is high.
-  If this property is missing, then assume the state as low (0).
-- ti,vsel1-state-high: Initial state of vsel1 input is high.
-  If this property is missing, then assume the state as low (0).
-
-Any property defined as part of the core regulator binding, defined in
-regulator.txt, can also be used.
-
-Example:
-
-	abc: tps62360 {
-		compatible = "ti,tps62361";
-		reg =  <0x60>;
-		regulator-name = "tps62361-vout";
-		regulator-min-microvolt = <500000>;
-		regulator-max-microvolt = <1500000>;
-		regulator-boot-on
-		ti,vsel0-gpio = <&gpio1 16 0>;
-		ti,vsel1-gpio = <&gpio1 17 0>;
-		ti,vsel0-state-high;
-		ti,vsel1-state-high;
-		ti,enable-pull-down;
-		ti,enable-force-pwm;
-		ti,enable-vout-discharge;
-	};
-- 
2.34.1


  parent reply	other threads:[~2021-12-17 17:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 17:05 [PATCH 1/6] dt-bindings: regulator: palmas: Convert to json-schema Thierry Reding
2021-12-17 17:05 ` [PATCH 2/6] dt-bindings: regulator: pwm: " Thierry Reding
2021-12-18 18:08   ` Rob Herring
2021-12-21 18:49   ` Rob Herring
2021-12-17 17:05 ` [PATCH 3/6] dt-bindings: regulator: tps51632: " Thierry Reding
2021-12-21 18:51   ` Rob Herring
2021-12-17 17:05 ` Thierry Reding [this message]
2021-12-21 18:52   ` [PATCH 4/6] dt-bindings: regulator: tps62360: " Rob Herring
2021-12-17 17:05 ` [PATCH 5/6] dt-bindings: regulator: tps6586x: " Thierry Reding
2021-12-18 18:08   ` Rob Herring
2021-12-21 18:59   ` Rob Herring
2021-12-17 17:05 ` [PATCH 6/6] dt-bindings: regulator: tps65090: " Thierry Reding
2021-12-21 19:00   ` Rob Herring
2021-12-18 18:08 ` [PATCH 1/6] dt-bindings: regulator: palmas: " Rob Herring
2021-12-21 14:15 ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211217170507.2843568-4-thierry.reding@gmail.com \
    --to=thierry.reding@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox