public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Sudharshan <sudharsanam346@gmail.com>
Cc: lars@metafoo.de, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org
Subject: Re: [PATCH v2] dt-bindings: iio: adc: adi,ad7816: add binding for AD7816/7/8
Date: Tue, 21 Apr 2026 10:51:04 +0100	[thread overview]
Message-ID: <20260421105104.199b2162@jic23-huawei> (raw)
In-Reply-To: <20260421060011.12917-1-sudharsanam346@gmail.com>

On Tue, 21 Apr 2026 11:30:11 +0530
Sudharshan <sudharsanam346@gmail.com> wrote:

> Add device tree binding documentation for Analog Devices AD7816,
> AD7817 and AD7818 10-bit ADC with on-chip temperature sensor.
> 
> The devices communicate over SPI and expose:
>   - up to 4 analog input channels (AD7817)
>   - on-chip temperature sensor
>   - a busy GPIO to signal ongoing conversion
> 
> Signed-off-by: Sudharshan <sudharsanam346@gmail.com>
> ---

I'm a little confused on why this is v2 as I can't find v1 and there
is no change log here.

There are various things missing. I'm not even sure you could make the chip
work with the subset represented here. Note bindings should be as complete
as possible even if the current driver doesn't use everything.


>  .../bindings/iio/adc/adi,ad7816.yaml          | 64 +++++++++++++++++++
>  1 file changed, 64 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
> new file mode 100644
> index 000000000000..6780510aaeb9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
> @@ -0,0 +1,64 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/adi,ad7816.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD7816/AD7817/AD7818 temperature sensor and ADC
> +
> +maintainers:
> +  - Michael Hennerich <michael.hennerich@analog.com>
> +
> +description: |
> +  The AD7816/AD7817/AD7818 are 10-bit analog to digital converters
> +  with an on-chip temperature sensor. They communicate over SPI bus
> +  and are commonly used in robotics and industrial applications for
> +  temperature monitoring and analog signal conversion.
> +
> +  Specifications on the converters can be found at:
> +    AD7816:
> +      https://www.analog.com/media/en/technical-documentation/data-sheets/AD7816.pdf
> +    AD7817:
> +      https://www.analog.com/media/en/technical-documentation/data-sheets/AD7817.pdf
> +    AD7818:
> +      https://www.analog.com/media/en/technical-documentation/data-sheets/AD7818.pdf
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,ad7816
> +      - adi,ad7817
> +      - adi,ad7818
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-max-frequency:
> +    maximum: 1000000
> +
> +  busy-gpios:

The data sheet calls out he most likely use of this which is not sensing when
it is busy but:
"The signal can be used to interrupt a microcontroller when a conversion
has finished."  That is how it is used in the driver in staging which reinforces
that view.  So make this one an interrupt.

However, there are other pins... For instance the !CONVST signal which I think
is best represented as a gpio.  There also seems to be a rd/!wr pin which you
don't have in this binding.

Hence this is far from complete and you should go take another look.
Also included power supplies which should be 'required' in the binding
if they are needed for the chip to work (at least some always are!) even if
the driver currently doesn't turn them on and off.

Thanks,

Jonathan


> +    description:
> +      GPIO connected to the busy pin of the AD7816/7/8.
> +      The line is active high and indicates the chip is
> +      performing a conversion.
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        adc@0 {
> +            compatible = "adi,ad7816";
> +            reg = <0>;
> +            spi-max-frequency = <1000000>;
> +            busy-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
> +        };
> +    };


      reply	other threads:[~2026-04-21  9:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21  6:00 [PATCH v2] dt-bindings: iio: adc: adi,ad7816: add binding for AD7816/7/8 Sudharshan
2026-04-21  9:51 ` Jonathan Cameron [this message]

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=20260421105104.199b2162@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sudharsanam346@gmail.com \
    /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