devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: dumitru.ceclan@analog.com
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	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 v3 1/6] dt-bindings: adc: ad7173: add support for ad411x
Date: Mon, 27 May 2024 18:48:35 +0100	[thread overview]
Message-ID: <20240527-arguably-said-361184ad848e@spud> (raw)
In-Reply-To: <20240527-ad4111-v3-1-7e9eddbbd3eb@analog.com>

[-- Attachment #1: Type: text/plain, Size: 5500 bytes --]

On Mon, May 27, 2024 at 08:02:34PM +0300, Dumitru Ceclan via B4 Relay wrote:
> From: Dumitru Ceclan <dumitru.ceclan@analog.com>
> 
> Add support for: AD4111, AD4112, AD4114, AD4115, AD4116.
> 
> AD411x family ADCs support a VCOM pin, dedicated for single-ended usage.
> AD4111/AD4112 support current channels, usage is implemented by
>  specifying channel reg values bigger than 15.
> 
> Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
> ---
>  .../devicetree/bindings/iio/adc/adi,ad7173.yaml    | 122 ++++++++++++++++++++-
>  1 file changed, 120 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..5b1af382dad3 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,36 @@ patternProperties:
>          maximum: 15
>  
>        diff-channels:
> +        description: |
> +          For using current channels specify select the current inputs
> +           and enable the adi,current-channel property.
> +
> +          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)−
> +
>          items:
>            minimum: 0
>            maximum: 31
>  
> +      single-channel:
> +        description: |
> +          Models AD4111 and AD4112 support single-ended current channels.
> +          To select the desired current input, specify the desired input pair:
> +            (IIN2+, IIN2−) -> single-channel = <2>
> +
> +        items:
> +          minimum: 1
> +          maximum: 16
> +
>        adi,reference-select:
>          description: |
>            Select the reference source to use when converting on
> @@ -154,9 +196,26 @@ patternProperties:
>            - avdd
>          default: refout-avss
>  
> +      adi,current-channel:
> +        description: |
> +          Signal that the selected inputs are current channels.
> +          Only available on AD4111 and AD4112.
> +        type: boolean
> +
> +      adi,channel-type:
> +        description:
> +          Used to differentiate between different channel types as the device
> +           register configurations are the same for all usage types.
> +          Both pseudo-differential and single-ended channels will use the
> +           single-ended specifier.
> +        $ref: /schemas/types.yaml#/definitions/string
> +        enum:
> +          - single-ended
> +          - differential
> +        default: differential

I dunno if my brain just ain't workin' right today, or if this is not
sufficiently explained, but why is this property needed? You've got
diff-channels and single-channels already, why can you not infer the
information you need from them? What should software do with this
information?
Additionally, "pseudo-differential" is not explained in this binding.

Also, what does "the device register configurations are the same for
all uses types" mean? The description here implies that you'd be reading
the registers to determine the configuration, but as far as I understand
it's the job of drivers to actually configure devices.
The only way I could interpret this that makes sense to me is that you're
trying to say that the device doesn't have registers that allow you to
do runtime configuration detection - but that's the norm and I would not
call it out here.

Thanks,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2024-05-27 17:48 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 17:02 [PATCH v3 0/6] Add support for AD411x Dumitru Ceclan via B4 Relay
2024-05-27 17:02 ` [PATCH v3 1/6] dt-bindings: adc: ad7173: add support for ad411x Dumitru Ceclan via B4 Relay
2024-05-27 17:48   ` Conor Dooley [this message]
2024-05-28 12:16     ` Ceclan, Dumitru
2024-05-28 17:52       ` Conor Dooley
2024-05-29 13:38         ` Ceclan, Dumitru
2024-05-29 16:04           ` Conor Dooley
2024-05-30  7:50             ` Nuno Sá
2024-05-30 11:55               ` Ceclan, Dumitru
2024-05-29 22:04           ` David Lechner
2024-05-30  7:12             ` Nuno Sá
2024-05-27 17:02 ` [PATCH v3 2/6] iio: adc: ad7173: refactor channel configuration parsing Dumitru Ceclan via B4 Relay
2024-05-29 12:24   ` Nuno Sá
2024-05-27 17:02 ` [PATCH v3 3/6] iio: adc: ad7173: refactor ain and vref selection Dumitru Ceclan via B4 Relay
2024-05-29 12:27   ` Nuno Sá
2024-05-29 12:49     ` Nuno Sá
2024-05-30 14:45       ` Ceclan, Dumitru
2024-05-31  7:10         ` Nuno Sá
2024-06-01 18:40           ` Jonathan Cameron
2024-05-27 17:02 ` [PATCH v3 4/6] iio: adc: ad7173: add support for special inputs Dumitru Ceclan via B4 Relay
2024-05-29 12:29   ` Nuno Sá
2024-05-27 17:02 ` [PATCH v3 5/6] iio: adc: ad7173: Add support for AD411x devices Dumitru Ceclan via B4 Relay
2024-05-29 12:46   ` Nuno Sá
2024-05-29 14:03     ` Ceclan, Dumitru
2024-05-29 20:59       ` David Lechner
2024-05-30  6:19         ` Nuno Sá
2024-06-01 18:43           ` Jonathan Cameron
2024-05-27 17:02 ` [PATCH v3 6/6] iio: adc: ad7173: Reduce device info struct size Dumitru Ceclan via B4 Relay
2024-05-29 12:23   ` Nuno Sá
2024-05-29 20:32     ` David Lechner
2024-05-30  6:17       ` Nuno Sá

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=20240527-arguably-said-361184ad848e@spud \
    --to=conor@kernel.org \
    --cc=Michael.Hennerich@analog.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=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).