mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Janani Sunil <janani.sunil@analog.com>
To: "Marcelo Schmitt" <marcelo.schmitt@analog.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Ana-Maria Cusco" <ana-maria.cusco@analog.com>
Cc: Conor Dooley <conor.dooley@microchip.com>,
	<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux@analog.com>, <devicetree@vger.kernel.org>,
	Janani Sunil <jananisunil.dev@gmail.com>,
	Janani Sunil <janani.sunil@analog.com>,
	Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH 02/18] dt-bindings: iio: adc: ad4170-4: Restrict channel inputs to valid codes
Date: Thu, 3 Dec 2026 16:19:42 +0100	[thread overview]
Message-ID: <20261203-ad419x-release-v1-2-18578ab50524@analog.com> (raw)
In-Reply-To: <20261203-ad419x-release-v1-0-18578ab50524@analog.com>

single-channel and common-mode-channel select the CHANNEL_MAPn AINP_N
and AINM_N inputs just like diff-channels does, but they are not
constrained at all, so any number passes validation. Likewise, the
adi,excitation-pin properties accept codes 9 to 16, which
CURRENT_SOURCEn I_OUT_PIN marks reserved.

Apply the diff-channels constraints to single-channel and
common-mode-channel: AIN0 to AIN8 and the special inputs 17 to 29, with
no DAC output on devices without an integrated DAC. Restrict the
excitation pins to AIN0 to AIN8 and GPIO0 to GPIO3.

Fixes: 1b3cee41235b ("dt-bindings: iio: adc: Add AD4170-4")
Signed-off-by: Janani Sunil <janani.sunil@analog.com>
---
 .../devicetree/bindings/iio/adc/adi,ad4170-4.yaml  | 34 +++++++++++++++++-----
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad4170-4.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad4170-4.yaml
index ef5ca2ed8210..90ca4e39c216 100644
--- a/Documentation/devicetree/bindings/iio/adc/adi,ad4170-4.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ad4170-4.yaml
@@ -153,6 +153,14 @@ allOf:
                 anyOf:
                   - maximum: 19
                   - minimum: 21
+            single-channel:
+              anyOf:
+                - maximum: 19
+                - minimum: 21
+            common-mode-channel:
+              anyOf:
+                - maximum: 19
+                - minimum: 21
 
   # Only AD4170-4 can be clocked by an external crystal. The other devices
   # have no XTAL1 and XTAL2 pins.
@@ -283,6 +291,20 @@ patternProperties:
           enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23, 24, 25,
                  26, 27, 28, 29]
 
+      single-channel:
+        description:
+          Positive input of a pseudo-differential channel. Uses the same input
+          numbers as diff-channels.
+        enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+               26, 27, 28, 29]
+
+      common-mode-channel:
+        description:
+          Negative input of a pseudo-differential channel. Uses the same input
+          numbers as diff-channels.
+        enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+               26, 27, 28, 29]
+
       adi,reference-select:
         description: |
           Select the reference source to use when converting on the
@@ -323,8 +345,7 @@ patternProperties:
           Analog input to apply excitation current to while the channel
           is active.
         $ref: /schemas/types.yaml#/definitions/uint32
-        minimum: 0
-        maximum: 20
+        enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20]
         default: 0
 
       adi,excitation-pin-1:
@@ -332,8 +353,7 @@ patternProperties:
           Analog input to apply excitation current to while the channel
           is active.
         $ref: /schemas/types.yaml#/definitions/uint32
-        minimum: 0
-        maximum: 20
+        enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20]
         default: 0
 
       adi,excitation-pin-2:
@@ -341,8 +361,7 @@ patternProperties:
           Analog input to apply excitation current to while the channel
           is active.
         $ref: /schemas/types.yaml#/definitions/uint32
-        minimum: 0
-        maximum: 20
+        enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20]
         default: 0
 
       adi,excitation-pin-3:
@@ -350,8 +369,7 @@ patternProperties:
           Analog input to apply excitation current to while the channel
           is active.
         $ref: /schemas/types.yaml#/definitions/uint32
-        minimum: 0
-        maximum: 20
+        enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20]
         default: 0
 
       adi,excitation-current-0-microamp:

-- 
2.43.0


  parent reply	other threads:[~2026-12-03 15:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 15:19 [PATCH 00/18] iio: adc: ad4170-4: Fixes and AD4171-8/AD4190-8/AD4195-8 support Janani Sunil
2026-12-03 15:19 ` [PATCH 01/18] dt-bindings: iio: adc: ad4170-4: Restrict AD4170-4 only properties Janani Sunil
2026-12-03 15:19 ` Janani Sunil [this message]
2026-12-03 15:19 ` [PATCH 03/18] dt-bindings: iio: adc: ad4170-4: Allow running from the internal oscillator only Janani Sunil
2026-12-03 15:19 ` [PATCH 04/18] dt-bindings: iio: adc: ad4170-4: Fix the voltage bias description Janani Sunil
2026-12-03 15:19 ` [PATCH 05/18] iio: adc: ad4170-4: Fix out-of-bounds accesses to pins_fn[] Janani Sunil
2026-12-03 15:19 ` [PATCH 06/18] iio: adc: ad4170-4: Fix voltage bias programming Janani Sunil
2026-12-03 17:11   ` Andy Shevchenko
2026-12-03 15:19 ` [PATCH 07/18] iio: adc: ad4170-4: Fix overflow in sample rate fractional part Janani Sunil
2026-12-03 17:13   ` Andy Shevchenko
2026-12-03 15:19 ` [PATCH 08/18] iio: adc: ad4170-4: Fix output data rate on AD4190-4 and AD4195-4 Janani Sunil
2026-12-03 15:19 ` [PATCH 09/18] iio: adc: ad4170-4: Fix filter_fs adjustment on filter type change Janani Sunil
2026-12-03 15:19 ` [PATCH 10/18] iio: adc: ad4170-4: Fix lock order inversion with IIO direct mode Janani Sunil
2026-12-03 17:16   ` Andy Shevchenko
2026-12-03 15:19 ` [PATCH 11/18] iio: adc: ad4170-4: Fix sinc5 filter FILTER_FS range on AD4190-4 and AD4195-4 Janani Sunil
2026-12-03 17:17   ` Andy Shevchenko
2026-12-03 15:19 ` [PATCH 12/18] iio: adc: ad4170-4: Do not drive XTAL2 when using the internal clock Janani Sunil
2026-12-03 15:19 ` [PATCH 13/18] iio: adc: ad4170-4: Restrict current sources and AC excitation to supported parts Janani Sunil
2026-12-03 15:19 ` [PATCH 14/18] iio: adc: ad4170-4: Require equal chopped excitation currents Janani Sunil
2026-12-03 15:19 ` [PATCH 15/18] iio: adc: ad4170-4: Fix channel count with 15 external channels Janani Sunil
2026-12-03 15:19 ` [PATCH 16/18] iio: adc: ad4170-4: Drop ad4170_iout_pin_tbl Janani Sunil
2026-12-03 17:21   ` Andy Shevchenko
2026-12-03 15:19 ` [PATCH 17/18] dt-bindings: iio: adc: ad4170-4: Add AD4171-8, AD4190-8 and AD4195-8 Janani Sunil
2026-12-03 15:19 ` [PATCH 18/18] iio: adc: ad4170-4: Add support for " Janani Sunil
2026-12-03 17:23   ` Andy Shevchenko
2026-12-03 17:18 ` [PATCH 00/18] iio: adc: ad4170-4: Fixes and AD4171-8/AD4190-8/AD4195-8 support Andy Shevchenko

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=20261203-ad419x-release-v1-2-18578ab50524@analog.com \
    --to=janani.sunil@analog.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=ana-maria.cusco@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jananisunil.dev@gmail.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@analog.com \
    --cc=marcelo.schmitt@analog.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@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®