devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Dumitru Ceclan via B4 Relay
	<devnull+dumitru.ceclan.analog.com@kernel.org>
Cc: dumitru.ceclan@analog.com, Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	David Lechner <dlechner@baylibre.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Dumitru Ceclan <mitrutzceclan@gmail.com>
Subject: Re: [PATCH v4 1/6] dt-bindings: adc: ad7173: add support for ad411x
Date: Sat, 1 Jun 2024 19:35:12 +0100	[thread overview]
Message-ID: <20240601193512.0e17992b@jic23-huawei> (raw)
In-Reply-To: <20240531-ad4111-v4-1-64607301c057@analog.com>

On Fri, 31 May 2024 22:42:27 +0300
Dumitru Ceclan via B4 Relay <devnull+dumitru.ceclan.analog.com@kernel.org> wrote:

> From: Dumitru Ceclan <dumitru.ceclan@analog.com>
> 
> Add support for: AD4111, AD4112, AD4114, AD4115, AD4116.
> 
> AD411x family ADCs support a VCOM pin. The purpose of this pin is to
> offer a dedicated common-mode voltage input for single-ended channels.
> This pin is specified as supporting a differential channel with VIN10 on
> model AD4116.
> 
> AD4111/AD4112 support current channels. Support is implemented using
> single-channel and "adi,current-channel".
> 
> Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
I like the common-mode-channel solution to the pseudo differential
description. It makes things explicit whilst avoiding an ugly differential
but not differential mess.

However, it feels like a general thing to me not a vendor specific one.
Perhaps makes sense to put in adc.yaml?

One other question that is more me being curious and failing to understand
the datasheet than a request to change anything.
> ---
>  .../devicetree/bindings/iio/adc/adi,ad7173.yaml    | 192 ++++++++++++++++++++-
>  1 file changed, 190 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml
> index ea6cfcd0aff4..d8474eee553e 100644
> --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml
> @@ -19,7 +19,18 @@ description: |
>    primarily for measurement of signals close to DC but also delivers
>    outstanding performance with input bandwidths out to ~10kHz.
>  
> +  Analog Devices AD411x ADC's:
> +  The AD411X family encompasses a series of low power, low noise, 24-bit,
> +  sigma-delta analog-to-digital converters that offer a versatile range of
> +  specifications. They integrate an analog front end suitable for processing
> +  fully differential/single-ended and bipolar voltage inputs.
> +
>    Datasheets for supported chips:
> +    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4111.pdf
> +    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4112.pdf
> +    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4114.pdf
> +    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4115.pdf
> +    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4116.pdf
>      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
> @@ -31,6 +42,11 @@ description: |
>  properties:
>    compatible:
>      enum:
> +      - adi,ad4111
> +      - adi,ad4112
> +      - adi,ad4114
> +      - adi,ad4115
> +      - adi,ad4116
>        - adi,ad7172-2
>        - adi,ad7172-4
>        - adi,ad7173-8
> @@ -129,10 +145,54 @@ patternProperties:
>          maximum: 15
>  
>        diff-channels:
> +        description: |
> +          This property is used for defining the inputs of a differential
> +          voltage channel. The first value is the positive input and the second
> +          value is the negative input of the channel.
> +
> +          Family AD411x supports a dedicated VINCOM voltage input.
> +          To select it set the second channel to 16.
> +            (VIN2, VINCOM) -> diff-channels = <2 16>
> +
> +          There are special values that can be selected besides the voltage
> +          analog inputs:
> +            21: REF+
> +            22: REF−
> +          Supported only by AD7172-2, AD7172-4, AD7175-2, AD7175-8, AD7177-2:
> +            19: ((AVDD1 − AVSS)/5)+
> +            20: ((AVDD1 − AVSS)/5)−

That's what it says on the datasheet (so fine to copy that here) but I'm curious, what does
that mean in practice?  How can we have negative and postive signals of the difference
between two power supply voltages where I'm fairly sure AVDD1 always greater than AVSS.

Anyhow, that's a problem for the person reading the datasheet to figure out :)
 
> +
>          items:
>            minimum: 0
>            maximum: 31
>  
> +      single-channel:
> +        description: |
> +          This property is used for defining a current channel or the positive
> +          input of a voltage channel (single-ended or pseudo-differential).
> +
> +          Models AD4111 and AD4112 support current channels.
> +            Example: (IIN2+, IIN2−) -> single-channel = <2>
> +          To correctly configure a current channel set the "adi,current-channel"
> +          property to true.
> +
> +          To configure a single-ended/pseudo-differential channel set the
> +          "adi,common-mode-channel" property to the desired negative voltage input.
> +
> +          When used as a voltage channel, special inputs are valid as well.
> +        minimum: 0
> +        maximum: 31
> +
> +      adi,common-mode-channel:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description:
> +          This property is used for defining the negative input of a
> +          single-ended or pseudo-differential voltage channel.
> +
> +          Special inputs are valid as well.
> +        minimum: 0
> +        maximum: 31
> +


  reply	other threads:[~2024-06-01 18:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31 19:42 [PATCH v4 0/6] Add support for AD411x Dumitru Ceclan via B4 Relay
2024-05-31 19:42 ` [PATCH v4 1/6] dt-bindings: adc: ad7173: add support for ad411x Dumitru Ceclan via B4 Relay
2024-06-01 18:35   ` Jonathan Cameron [this message]
2024-06-03  9:46     ` Ceclan, Dumitru
2024-06-03 20:00       ` Jonathan Cameron
2024-06-05  6:54         ` Ceclan, Dumitru
2024-06-06 19:58           ` Jonathan Cameron
2024-06-07  7:29             ` Ceclan, Dumitru
2024-05-31 19:42 ` [PATCH v4 2/6] iio: adc: ad7173: refactor channel configuration parsing Dumitru Ceclan via B4 Relay
2024-05-31 19:42 ` [PATCH v4 3/6] iio: adc: ad7173: refactor ain and vref selection Dumitru Ceclan via B4 Relay
2024-06-01 18:49   ` Jonathan Cameron
2024-06-03 13:00     ` Nuno Sá
2024-06-03 13:08       ` Ceclan, Dumitru
2024-06-03 16:00         ` David Lechner
2024-06-03 16:39           ` Ceclan, Dumitru
2024-05-31 19:42 ` [PATCH v4 4/6] iio: adc: ad7173: add support for special inputs Dumitru Ceclan via B4 Relay
2024-06-01 18:51   ` Jonathan Cameron
2024-05-31 19:42 ` [PATCH v4 5/6] iio: adc: ad7173: refactor device info structs Dumitru Ceclan via B4 Relay
2024-06-01 18:52   ` Jonathan Cameron
2024-05-31 19:42 ` [PATCH v4 6/6] iio: adc: ad7173: Add support for AD411x devices Dumitru Ceclan via B4 Relay
2024-06-01 19:19   ` Jonathan Cameron
2024-06-03 10:11     ` Ceclan, Dumitru
2024-06-03 20:07       ` 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=20240601193512.0e17992b@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=devnull+dumitru.ceclan.analog.com@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=dumitru.ceclan@analog.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitrutzceclan@gmail.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;
as well as URLs for NNTP newsgroup(s).