All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Rob Herring <robh@kernel.org>, Tomas Novotny <tomas@novotny.cz>
Subject: [PATCH v2 20/29] dt-bindings:iio:dac:microchip,mcp4725 yaml conversion
Date: Sat, 31 Oct 2020 13:41:01 +0000	[thread overview]
Message-ID: <20201031134110.724233-21-jic23@kernel.org> (raw)
In-Reply-To: <20201031134110.724233-1-jic23@kernel.org>

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

I'm not sure vdd-supply absolutely has to be provided if vref-supply
is, but as the previous binding docs stated it was required it seems
reasonable to leave it as such.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Tomas Novotny <tomas@novotny.cz>
---
 .../devicetree/bindings/iio/dac/mcp4725.txt   | 35 ---------
 .../bindings/iio/dac/microchip,mcp4725.yaml   | 71 +++++++++++++++++++
 2 files changed, 71 insertions(+), 35 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/dac/mcp4725.txt b/Documentation/devicetree/bindings/iio/dac/mcp4725.txt
deleted file mode 100644
index 1bc6c093fbfe..000000000000
--- a/Documentation/devicetree/bindings/iio/dac/mcp4725.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-Microchip mcp4725 and mcp4726 DAC device driver
-
-Required properties:
-	- compatible: Must be "microchip,mcp4725" or "microchip,mcp4726"
-	- reg: Should contain the DAC I2C address
-	- vdd-supply: Phandle to the Vdd power supply. This supply is used as a
-	  voltage reference on mcp4725. It is used as a voltage reference on
-	  mcp4726 if there is no vref-supply specified.
-
-Optional properties (valid only for mcp4726):
-	- vref-supply: Optional phandle to the Vref power supply. Vref pin is
-	  used as a voltage reference when this supply is specified.
-	- microchip,vref-buffered: Boolean to enable buffering of the external
-	  Vref pin. This boolean is not valid without the vref-supply. Quoting
-	  the datasheet: This is offered in cases where the reference voltage
-	  does not have the current capability not to drop its voltage when
-	  connected to the internal resistor ladder circuit.
-
-Examples:
-
-	/* simple mcp4725 */
-	mcp4725@60 {
-		compatible = "microchip,mcp4725";
-		reg = <0x60>;
-		vdd-supply = <&vdac_vdd>;
-	};
-
-	/* mcp4726 with the buffered external reference voltage */
-	mcp4726@60 {
-		compatible = "microchip,mcp4726";
-		reg = <0x60>;
-		vdd-supply = <&vdac_vdd>;
-		vref-supply = <&vdac_vref>;
-		microchip,vref-buffered;
-	};
diff --git a/Documentation/devicetree/bindings/iio/dac/microchip,mcp4725.yaml b/Documentation/devicetree/bindings/iio/dac/microchip,mcp4725.yaml
new file mode 100644
index 000000000000..271998610ceb
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/dac/microchip,mcp4725.yaml
@@ -0,0 +1,71 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/microchip,mcp4725.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip mcp4725 and mcp4726 DAC
+
+maintainers:
+  - Tomas Novotny <tomas@novotny.cz>
+
+properties:
+  compatible:
+    enum:
+      - microchip,mcp4725
+      - microchip,mcp4726
+
+  reg:
+    maxItems: 1
+
+  vdd-supply:
+    description: |
+      Provides both power and acts as the reference supply on the mcp4725.
+      For the mcp4726 it will be used as the reference voltage if vref-supply
+      is not provided.
+
+  vref-supply:
+    description:
+      Vref pin is used as a voltage reference when this supply is specified.
+
+  microchip,vref-buffered:
+    type: boolean
+    description: |
+      Enable buffering of the external Vref pin. This boolean is not valid
+      without the vref-supply. Quoting the datasheet: This is offered in
+      cases where the reference voltage does not have the current
+      capability not to drop its voltage when connected to the internal
+      resistor ladder circuit.
+
+allOf:
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              const: microchip,mcp4726
+    then:
+      properties:
+        vref-supply: false
+        microchip,vref-buffered: false
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mcp4725@60 {
+            compatible = "microchip,mcp4725";
+            reg = <0x60>;
+            vdd-supply = <&vdac_vdd>;
+        };
+    };
+...
-- 
2.28.0


  parent reply	other threads:[~2020-10-31 13:44 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 13:40 [PATCH v2 00/29] dt-bindings:iio: Another set of yaml conversions Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 01/29] dt-bindings:iio:humidity:hdc100x Drop separate doc + add to trivial-devices Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 02/29] dt-bindings:iio:humidity:htu21 " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 03/29] dt-bindings:iio:humidity:st,hts221 yaml conversion Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 04/29] dt-bindings:iio:humidity:dht11 " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 05/29] dt-bindings:iio:pressure:ms5637 Drop separate doc + add to trivial-devices Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 06/29] dt-bindings:iio:pressure:murata,zpa2326 yaml conversion Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 07/29] dt-bindings:iio:pressure:meas,ms5611 " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 08/29] dt-bindings:iio:pressure:hoperf,hp03 " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 09/29] dt-bindings:iio:proximity:semtech,sx9500 " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 10/29] dt-bindings:iio:proximity:st,vl53l0x " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 11/29] dt-bindings:iio:proximity:ams,as3935 " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 12/29] dt-bindings:iio:dac:ti,dac5571 " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 13/29] dt-bindings:iio:dac:ti,dac7311 " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 14/29] dt-bindings:iio:dac:ti,dac7512 " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 15/29] dt-bindings:iio:dac:ti,dac7612 " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 16/29] dt-bindings:iio:dac:ti,dac082s085 " Jonathan Cameron
2020-10-31 16:58   ` Lukas Wunner
2020-10-31 18:11     ` Jonathan Cameron
2020-11-03  2:21   ` Rob Herring
2020-11-08 16:34     ` Jonathan Cameron
2021-03-14 19:07       ` Jonathan Cameron
2021-03-14 19:23         ` Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 17/29] dt-bindings:iio:dac:adi,ad7303 " Jonathan Cameron
2020-10-31 13:40 ` [PATCH v2 18/29] dt-bindings:iio:dac:maxim,ds4424 " Jonathan Cameron
2020-10-31 13:41 ` [PATCH v2 19/29] dt-bindings:iio:dac:fsl,vf610-dac " Jonathan Cameron
2020-10-31 13:41 ` Jonathan Cameron [this message]
2020-10-31 13:41 ` [PATCH v2 21/29] dt-bindings:iio:dac:maxim,max5821 " Jonathan Cameron
2020-10-31 13:41 ` [PATCH v2 22/29] dt-bindings:iio:dac:nxp,lpc1850-dac " Jonathan Cameron
2020-10-31 13:41 ` [PATCH v2 23/29] dt-bindings:iio:dac:adi,ad5758 " Jonathan Cameron
2020-10-31 13:41 ` [PATCH v2 24/29] dt-bindings:iio:temperature:melexis,mlx90614 " Jonathan Cameron
2020-11-02  9:12   ` Crt Mori
2020-11-02 17:39     ` Jonathan Cameron
2020-10-31 13:41 ` [PATCH v2 25/29] dt-bindings:iio:temperature:melexis,mlx90632 conversion to yaml Jonathan Cameron
2020-10-31 13:41 ` [PATCH v2 26/29] dt-bindings:iio:temperature:meas,tsys01 move to trivial-devices.yaml Jonathan Cameron
2020-11-01 15:25   ` Manivannan Sadhasivam
2020-10-31 13:41 ` [PATCH v2 27/29] dt-bindings:iio:temperature:maxim,max31856 yaml conversion Jonathan Cameron
2020-10-31 13:41 ` [PATCH v2 28/29] dt-bindings:iio:temperature:maxim_thermocouple.txt to maxim,max31855k.yaml Jonathan Cameron
2020-10-31 13:41 ` [PATCH v2 29/29] dt-bindings:iio:temperature:ti,tmp07 yaml conversion Jonathan Cameron
2020-11-16 20:17 ` [PATCH v2 00/29] dt-bindings:iio: Another set of yaml conversions Jonathan Cameron

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=20201031134110.724233-21-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=tomas@novotny.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.