public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: iio: adc: adi,ad7816: add binding for AD7816/7/8
@ 2026-04-21  6:00 Sudharshan
  2026-04-21  9:51 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Sudharshan @ 2026-04-21  6:00 UTC (permalink / raw)
  To: jic23; +Cc: lars, linux-iio, linux-kernel, devicetree, robh, Sudharshan

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>
---
 .../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:
+    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>;
+        };
+    };
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] dt-bindings: iio: adc: adi,ad7816: add binding for AD7816/7/8
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2026-04-21  9:51 UTC (permalink / raw)
  To: Sudharshan; +Cc: lars, linux-iio, linux-kernel, devicetree, robh

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>;
> +        };
> +    };


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-21  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox