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>,
	Peter Rosin <peda@axentia.se>
Subject: [PATCH 04/10] dt-bindings:iio:adc:envelope-detector: txt to yaml conversion.
Date: Sat, 31 Oct 2020 18:12:36 +0000	[thread overview]
Message-ID: <20201031181242.742301-5-jic23@kernel.org> (raw)
In-Reply-To: <20201031181242.742301-1-jic23@kernel.org>

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

Straight forward format conversion.  The example in here is fun in
that it has 2 separate provider / consumer pairs.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Peter Rosin <peda@axentia.se>
---
 .../bindings/iio/adc/envelope-detector.txt    | 54 ------------
 .../bindings/iio/adc/envelope-detector.yaml   | 87 +++++++++++++++++++
 2 files changed, 87 insertions(+), 54 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt b/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt
deleted file mode 100644
index 27544bdd4478..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-Bindings for ADC envelope detector using a DAC and a comparator
-
-The DAC is used to find the peak level of an alternating voltage input
-signal by a binary search using the output of a comparator wired to
-an interrupt pin. Like so:
-                          _
-                         | \
-    input +------>-------|+ \
-                         |   \
-           .-------.     |    }---.
-           |       |     |   /    |
-           |    dac|-->--|- /     |
-           |       |     |_/      |
-           |       |              |
-           |       |              |
-           |    irq|------<-------'
-           |       |
-           '-------'
-
-Required properties:
-- compatible: Should be "axentia,tse850-envelope-detector"
-- io-channels: Channel node of the dac to be used for comparator input.
-- io-channel-names: Should be "dac".
-- interrupt specification for one client interrupt,
-  see ../../interrupt-controller/interrupts.txt for details.
-- interrupt-names: Should be "comp".
-
-Example:
-
-	&i2c {
-		dpot: mcp4651-104@28 {
-			compatible = "microchip,mcp4651-104";
-			reg = <0x28>;
-			#io-channel-cells = <1>;
-		};
-	};
-
-	dac: dac {
-		compatible = "dpot-dac";
-		vref-supply = <&reg_3v3>;
-		io-channels = <&dpot 0>;
-		io-channel-names = "dpot";
-		#io-channel-cells = <1>;
-	};
-
-	envelope-detector {
-		compatible = "axentia,tse850-envelope-detector";
-		io-channels = <&dac 0>;
-		io-channel-names = "dac";
-
-		interrupt-parent = <&gpio>;
-		interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
-		interrupt-names = "comp";
-	};
diff --git a/Documentation/devicetree/bindings/iio/adc/envelope-detector.yaml b/Documentation/devicetree/bindings/iio/adc/envelope-detector.yaml
new file mode 100644
index 000000000000..6048be936aba
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/envelope-detector.yaml
@@ -0,0 +1,87 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/envelope-detector.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ADC envelope detector using a DAC and a comparator
+
+maintainers:
+  - Peter Rosin <peda@axentia.se>
+
+description: |
+  The DAC is used to find the peak level of an alternating voltage input
+  signal by a binary search using the output of a comparator wired to
+  an interrupt pin. Like so:
+                          _
+                         | \
+    input +------>-------|+ \
+                         |   \
+           .-------.     |    }---.
+           |       |     |   /    |
+           |    dac|-->--|- /     |
+           |       |     |_/      |
+           |       |              |
+           |       |              |
+           |    irq|------<-------'
+           |       |
+           '-------'
+
+properties:
+  compatible:
+    const: axentia,tse850-envelope-detector
+
+  io-channels:
+    maxItems: 1
+    description: Channel node of the dac to be used for comparator input.
+
+  io-channel-names:
+    const: dac
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-names:
+    const: comp
+
+required:
+  - compatible
+  - io-channels
+  - io-channel-names
+  - interrupts
+  - interrupt-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dpot: dpot@28 {
+            compatible = "microchip,mcp4651-104";
+            reg = <0x28>;
+            #io-channel-cells = <1>;
+        };
+    };
+
+    dac: dac {
+        compatible = "dpot-dac";
+        vref-supply = <&reg_3v3>;
+        io-channels = <&dpot 0>;
+        io-channel-names = "dpot";
+        #io-channel-cells = <1>;
+    };
+
+    envelope-detector {
+        compatible = "axentia,tse850-envelope-detector";
+        io-channels = <&dac 0>;
+        io-channel-names = "dac";
+
+        interrupt-parent = <&gpio>;
+        interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
+        interrupt-names = "comp";
+    };
+...
+
-- 
2.28.0


  parent reply	other threads:[~2020-10-31 18:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 18:12 [PATCH 00/10] dt-bindings: iio: conversion of consumer drivers Jonathan Cameron
2020-10-31 18:12 ` [PATCH 01/10] dt-bindings:iio:iio-binding.txt Drop file as content now in dt-schema Jonathan Cameron
2020-10-31 18:12 ` [PATCH 02/10] dt-bindings:iio:dac:dpot-dac: yaml conversion Jonathan Cameron
2020-10-31 18:12 ` [PATCH 03/10] dt-bindings:iio:potentiometer: give microchip,mcp4531 its own binding Jonathan Cameron
2020-10-31 18:12 ` Jonathan Cameron [this message]
2020-10-31 18:12 ` [PATCH 05/10] dt-bindings:iio:afe:current-sense-amplifier: txt to yaml conversion Jonathan Cameron
2020-11-03 15:55   ` Rob Herring
2020-10-31 18:12 ` [PATCH 06/10] dt-bindings:iio:afe:current-sense-shunt: " Jonathan Cameron
2020-10-31 18:12 ` [PATCH 07/10] dt-bindings:iio:adc:maxim,max1027: Pull out to separate binding doc Jonathan Cameron
2020-11-01 13:25   ` Miquel Raynal
2020-11-01 20:33     ` Jonathan Cameron
2020-11-28 17:47       ` Jonathan Cameron
2020-10-31 18:12 ` [PATCH 08/10] dt-bindings:iio:afe:voltage-divider: txt to yaml conversion Jonathan Cameron
2020-10-31 18:12 ` [PATCH 09/10] dt-bindings:iio:light:capella,cm3605: " Jonathan Cameron
2020-11-04 14:46   ` Linus Walleij
2020-11-08 16:00     ` Jonathan Cameron
2020-10-31 18:12 ` [PATCH 10/10] dt-bindings:iio:potentiostat:ti,lmp91000: " Jonathan Cameron
2020-10-31 21:41   ` Matt Ranostay
2020-11-28 17:56     ` Jonathan Cameron
2020-11-03 16:07 ` [PATCH 00/10] dt-bindings: iio: conversion of consumer drivers Rob Herring
2020-11-28 17:57   ` 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=20201031181242.742301-5-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=peda@axentia.se \
    --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 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.