All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dumitru Ceclan <mitrutzceclan@gmail.com>
To: dumitru.ceclan@analog.com
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, lars@metafoo.de, jic23@kernel.org,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, dlechner@baylibre.com,
	Dumitru Ceclan <mitrutzceclan@gmail.com>
Subject: [PATCH v3 1/3] dt-bindings: adc: ad7173: add support for additional models
Date: Wed,  6 Mar 2024 13:09:54 +0200	[thread overview]
Message-ID: <20240306110956.13167-2-mitrutzceclan@gmail.com> (raw)
In-Reply-To: <20240306110956.13167-1-mitrutzceclan@gmail.com>

Add support for: AD7172-2, AD7175-8, AD7177-2.
AD7172-4 does not feature an internal reference, check for external
 reference presence.

Signed-off-by: Dumitru Ceclan <mitrutzceclan@gmail.com>
---
 .../bindings/iio/adc/adi,ad7173.yaml          | 39 +++++++++++++++++--
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml
index 36f16a325bc5..ea6cfcd0aff4 100644
--- a/Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml
@@ -21,17 +21,23 @@ description: |
 
   Datasheets for supported chips:
     https://www.analog.com/media/en/technical-documentation/data-sheets/AD7172-2.pdf
+    https://www.analog.com/media/en/technical-documentation/data-sheets/AD7172-4.pdf
     https://www.analog.com/media/en/technical-documentation/data-sheets/AD7173-8.pdf
     https://www.analog.com/media/en/technical-documentation/data-sheets/AD7175-2.pdf
+    https://www.analog.com/media/en/technical-documentation/data-sheets/AD7175-8.pdf
     https://www.analog.com/media/en/technical-documentation/data-sheets/AD7176-2.pdf
+    https://www.analog.com/media/en/technical-documentation/data-sheets/AD7177-2.pdf
 
 properties:
   compatible:
     enum:
       - adi,ad7172-2
+      - adi,ad7172-4
       - adi,ad7173-8
       - adi,ad7175-2
+      - adi,ad7175-8
       - adi,ad7176-2
+      - adi,ad7177-2
 
   reg:
     maxItems: 1
@@ -136,8 +142,10 @@ patternProperties:
           refout-avss: REFOUT/AVSS (Internal reference)
           avdd       : AVDD  /AVSS
 
-          External reference ref2 only available on ad7173-8.
-          If not specified, internal reference used.
+          External reference ref2 only available on ad7173-8 and ad7172-4.
+          Internal reference refout-avss not available on ad7172-4.
+
+          If not specified, internal reference used (if available).
         $ref: /schemas/types.yaml#/definitions/string
         enum:
           - vref
@@ -157,12 +165,17 @@ required:
 allOf:
   - $ref: /schemas/spi/spi-peripheral-props.yaml#
 
+  # Only ad7172-4, ad7173-8 and ad7175-8 support vref2
+  # Other models have [0-3] channel registers
   - if:
       properties:
         compatible:
           not:
             contains:
-              const: adi,ad7173-8
+              enum:
+                - adi,ad7172-4
+                - adi,ad7173-8
+                - adi,ad7175-8
     then:
       properties:
         vref2-supply: false
@@ -177,6 +190,26 @@ allOf:
             reg:
               maximum: 3
 
+  # Model ad7172-4 does not support internal reference
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: adi,ad7172-4
+    then:
+      patternProperties:
+        "^channel@[0-9a-f]$":
+          properties:
+            reg:
+              maximum: 7
+            adi,reference-select:
+              enum:
+                - vref
+                - vref2
+                - avdd
+          required:
+            - adi,reference-select
+
   - if:
       anyOf:
         - required: [clock-names]
-- 
2.43.0


  reply	other threads:[~2024-03-06 11:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 11:09 [PATCH v3 0/3] Add support for additional AD717x models Dumitru Ceclan
2024-03-06 11:09 ` Dumitru Ceclan [this message]
2024-03-06 18:12   ` [PATCH v3 1/3] dt-bindings: adc: ad7173: add support for additional models Conor Dooley
2024-03-06 11:09 ` [PATCH v3 2/3] iio: adc: ad7173: improve chip id's defines Dumitru Ceclan
2024-03-06 11:09 ` [PATCH v3 3/3] iio: adc: ad7173: add support for additional models Dumitru Ceclan
2024-03-10 15:06 ` [PATCH v3 0/3] Add support for additional AD717x models 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=20240306110956.13167-2-mitrutzceclan@gmail.com \
    --to=mitrutzceclan@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=dumitru.ceclan@analog.com \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.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 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.