mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alisa-Dariana Roman <alisadariana@gmail.com>
To: Alisa-Dariana Roman <alisa.roman@analog.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Michael Hennerich <michael.hennerich@analog.com>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Alexandru Tachici <alexandru.tachici@analog.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
Subject: [PATCH v2 3/4] dt-bindings: iio: adc: ad7192: Add AD7194 support
Date: Tue, 14 Nov 2023 22:05:32 +0200	[thread overview]
Message-ID: <20231114200533.137995-4-alisa.roman@analog.com> (raw)
In-Reply-To: <20231114200533.137995-1-alisa.roman@analog.com>

Unlike the other AD719Xs, AD7194 has configurable differential
channels. The default configuration for these channels can be changed
from the devicetree.

Also add an example for AD7194 devicetree.

Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com>
---
 .../bindings/iio/adc/adi,ad7192.yaml          | 74 +++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml
index 9b59d6eea368..800b396f5993 100644
--- a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml
@@ -21,6 +21,7 @@ properties:
       - adi,ad7190
       - adi,ad7192
       - adi,ad7193
+      - adi,ad7194
       - adi,ad7195
 
   reg:
@@ -108,6 +109,42 @@ required:
 
 allOf:
   - $ref: /schemas/spi/spi-peripheral-props.yaml#
+  - if:
+      properties:
+        compatible:
+          const: adi,ad7194
+    then:
+      properties:
+        '#address-cells':
+          const: 1
+
+        '#size-cells':
+          const: 0
+
+      patternProperties:
+        "^channel@([0-7a-f])$":
+          type: object
+          $ref: adc.yaml
+          unevaluatedProperties: false
+
+          properties:
+            reg:
+              description: The channel index.
+              minimum: 0
+              maximum: 7
+
+            diff-channels:
+              description: |
+                The differential channel pair for Ad7194 configurable channels. The
+                first channel is the positive input, the second channel is the
+                negative input.
+              items:
+                minimum: 1
+                maximum: 16
+
+          required:
+            - reg
+            - diff-channels
 
 unevaluatedProperties: false
 
@@ -137,3 +174,40 @@ examples:
             adi,burnout-currents-enable;
         };
     };
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@0 {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            compatible = "adi,ad7194";
+            reg = <0>;
+            spi-max-frequency = <1000000>;
+            spi-cpol;
+            spi-cpha;
+            clocks = <&ad7192_mclk>;
+            clock-names = "mclk";
+            interrupts = <25 0x2>;
+            interrupt-parent = <&gpio>;
+            dvdd-supply = <&dvdd>;
+            avdd-supply = <&avdd>;
+            vref-supply = <&vref>;
+
+            adi,refin2-pins-enable;
+            adi,rejection-60-Hz-enable;
+            adi,buffer-enable;
+            adi,burnout-currents-enable;
+
+            channel@0 {
+                reg = <0>;
+                diff-channels = <1 6>;
+            };
+
+            channel@1 {
+                reg = <1>;
+                diff-channels = <2 3>;
+            };
+        };
+    };
-- 
2.34.1


  parent reply	other threads:[~2023-11-14 20:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 20:05 [PATCH v2 0/4] iio: adc: ad7192: Add support for AD7194 Alisa-Dariana Roman
2023-11-14 20:05 ` [PATCH v2 1/4] dt-bindings: iio: adc: ad7192: Add properties Alisa-Dariana Roman
2023-11-14 20:29   ` Krzysztof Kozlowski
2023-11-26 16:11     ` Jonathan Cameron
2024-02-02 14:14     ` Alisa-Dariana Roman
2024-02-02 14:29       ` Krzysztof Kozlowski
2024-02-02 22:20       ` David Lechner
2024-02-05  9:28         ` Krzysztof Kozlowski
2024-02-05  9:50           ` Nuno Sá
2023-11-14 20:05 ` [PATCH v2 2/4] iio: adc: ad7192: Use device api Alisa-Dariana Roman
2023-11-15 14:08   ` Nuno Sá
2023-11-14 20:05 ` Alisa-Dariana Roman [this message]
2023-11-14 20:30   ` [PATCH v2 3/4] dt-bindings: iio: adc: ad7192: Add AD7194 support Krzysztof Kozlowski
2023-11-14 20:05 ` [PATCH v2 4/4] " Alisa-Dariana Roman
2023-11-15 14:20   ` Nuno Sá
2023-11-26 16:34   ` Jonathan Cameron
2024-02-02 14:32     ` Alisa-Dariana Roman
2024-02-04 13:04       ` 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=20231114200533.137995-4-alisa.roman@analog.com \
    --to=alisadariana@gmail.com \
    --cc=alexandru.tachici@analog.com \
    --cc=alisa.roman@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --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

all inboxes | Powered by JetHome®