From: Conor Dooley <conor@kernel.org>
To: "Nuno Sá" <nuno.sa@analog.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux@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>, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH 5/6] dt-bindings: iio: adc: add AD7793 and similar ADCs
Date: Fri, 27 Nov 2026 18:16:46 +0000 [thread overview]
Message-ID: <20261127-vertigo-smoking-fe2f90e28c88@spud> (raw)
In-Reply-To: <awlg_vzuEmw95dQM@nsa>
[-- Attachment #1: Type: text/plain, Size: 8930 bytes --]
On Fri, Nov 27, 2026 at 11:04:36AM +0000, Nuno Sá wrote:
> On Thu, Nov 26, 2026 at 06:25:13PM +0000, Conor Dooley wrote:
> > On Thu, Nov 26, 2026 at 12:24:28PM +0000, Nuno Sá wrote:
> > > On Wed, Nov 25, 2026 at 05:41:08PM +0000, Conor Dooley wrote:
> > > > On Wed, Nov 25, 2026 at 10:19:21AM +0000, Nuno Sá wrote:
> > > > > Add a binding for the AD7785, AD7792, AD7793, AD7794, AD7795, AD7796,
> > > > > AD7797, AD7798 and AD7799 low power sigma-delta ADCs. The driver has
> > > > > supported these parts for a long time, but only through platform data.
> > > > >
> > > > > The ADC reference is described by which supplies are present: REFIN
> > > > > (REFIN1 on the AD7794/AD7795), then REFIN2, and otherwise the internal
> > > > > 1.17 V reference. In the same way, an external clock on the CLK pin is
> > > > > used if one is given, and the internal 64 kHz clock otherwise.
> > > > >
> > > > > The remaining properties describe how the analog front end is wired:
> > > > > the input buffer (enabled by default, as it is at power-up), unipolar
> > > > > or bipolar coding, the burnout current sources, the bias voltage
> > > > > generator and the excitation current sources.
> > > > >
> > > > > Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> > > > > ---
> > > > > .../devicetree/bindings/iio/adc/adi,ad7793.yaml | 236 +++++++++++++++++++++
> > > > > MAINTAINERS | 10 +
> > > > > 2 files changed, 246 insertions(+)
> > > > >
> > > > > diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7793.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7793.yaml
> > > > > new file mode 100644
> > > > > index 000000000000..c4a0be06e5c0
> > > > > --- /dev/null
> > > > > +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7793.yaml
> > > > > @@ -0,0 +1,236 @@
> > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > > +%YAML 1.2
> > > > > +---
> > > > > +$id: http://devicetree.org/schemas/iio/adc/adi,ad7793.yaml#
> > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > > +
> > > > > +title: Analog Devices AD7793 and similar sigma-delta ADCs
> > > > > +
> > > > > +maintainers:
> > > > > + - Michael Hennerich <michael.hennerich@analog.com>
> > > > > + - Nuno Sá <nuno.sa@analog.com>
> > > > > +
> > > > > +description:
> > > > > + Low power, low noise sigma-delta ADCs with an SPI interface.
> > > > > +
> > > > > + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7785.pdf
> > > > > + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7792_7793.pdf
> > > > > + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7794_7795.pdf
> > > > > + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7796_7797.pdf
> > > > > + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7798_7799.pdf
> > > > > +
> > > > > +properties:
> > > > > + compatible:
> > > > > + enum:
> > > > > + - adi,ad7785
> > > > > + - adi,ad7792
> > > > > + - adi,ad7793
> > > > > + - adi,ad7794
> > > > > + - adi,ad7795
> > > > > + - adi,ad7796
> > > > > + - adi,ad7797
> > > > > + - adi,ad7798
> > > > > + - adi,ad7799
> > > > > +
> > > > > + reg:
> > > > > + maxItems: 1
> > > > > +
> > > > > + spi-cpol: true
> > > > > +
> > > > > + spi-cpha: true
> > > > > +
> > > > > + interrupts:
> > > > > + description: Interrupt connected to the DOUT/RDY pin.
> > > > > + maxItems: 1
> > > > > +
> > > > > + rdy-gpios:
> > > > > + description:
> > > > > + GPIO reading the DOUT/RDY line. DOUT/RDY also toggles during SPI
> > > > > + transfers, which usually triggers spurious interrupts. Reading this GPIO
> > > > > + allows to tell those apart from real conversion done events.
> > > > > + maxItems: 1
> > > > > +
> > > > > + avdd-supply: true
> > > > > +
> > > > > + dvdd-supply: true
> > > > > +
> > > > > + refin-supply:
> > > > > + description:
> > > > > + External reference applied between REFIN(+) and REFIN(-), or between
> > > > > + REFIN1(+) and REFIN1(-) on the AD7794 and AD7795. If present, it is used
> > > > > + as the ADC reference. If neither refin-supply nor refin2-supply are
> > > > > + present, the internal 1.17 V reference is used.
> > > > > +
> > > > > + refin2-supply:
> > > > > + description:
> > > > > + External reference applied between REFIN2(+) and REFIN2(-). Used as the
> > > > > + ADC reference if refin-supply is not present.
> > > > > +
> > > > > + clocks:
> > > > > + description:
> > > > > + External clock connected to the CLK pin. Either 64 kHz, or 128 kHz in
> > > > > + which case it gets divided by 2 internally. If not present, the internal
> > > > > + 64 kHz clock is used.
> > > > > + maxItems: 1
> > > > > +
> > > > > + bipolar:
> > > > > + description: see Documentation/devicetree/bindings/iio/adc/adc.yaml
> > > > > + type: boolean
> > > >
> > > > This is odd, why not ref the file normally?
> > >
> > > Yes, was not sure on this one but saw precedence in:
> > >
> > > https://elixir.bootlin.com/linux/v7.4-rc1/source/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml#L106
> > >
> > > Which might obviously be wrong! And I just noticed that in that one we
> > > do have it again referenced in the channel properties. So it might be
> > > just some legacy thing.
> >
> > Ah right of course, adc.yaml is for channels...
> >
> > >
> > > But in here the case is really this is a device wide (not per channel)
> > > property. But I realize that can just do:
> > >
> > > $ref: /schemas/iio/adc/adc.yaml#/properties/bipolar
> > >
> > > right?
> >
> > Happens a good bit for ports, I don't see why not here either.
>
> Will do.
>
> >
> > >
> > > >
> > > > > +
> > > > > + adi,buffer-disable:
> > > > > + description:
> > > > > + Operate the analog inputs in unbuffered mode. Unbuffered mode allows the
> > > > > + inputs to go from 30 mV below GND to 30 mV above AVDD, while buffered
> > > > > + mode needs 100 mV of headroom to the supply rails but tolerates source
> > > > > + impedances in front of the inputs. Buffered mode is always used for gains
> > > > > + higher than 2.
> > > > > + type: boolean
> > > >
> > > > What determines if the gain is higher than 2?
> > >
> > > Userspace does, through the scale attribute. So this property only has an effect when the gain is 1 or 2.
> > > For higher gains the buffer is always on
> > >
> > > >
> > > > > +
> > > > > + adi,burnout-currents-enable:
> > > > > + description:
> > > > > + Enable the 100 nA burnout current sources in the signal path, which allow
> > > > > + to detect an open circuit on the selected analog input. They can only be
> > > > > + enabled when either the buffer or the in-amp is active.
> > > >
> > > > The former should be somewhat enforceable with the binding, what
> > > > determins this in-amp's setting?
> > >
> > > Same deal. For gains >= 4, the in-amp becomes active in the path (and the buffer is forced on),
> > > so there's no way we can enforce this at the binding level:
> > >
> > > For gains 1 or 2, with adi,buffer-disable, adi,burnout-currents-enable is irrelevant, as the
> > > datasheet onl allows the burnout currents with the buffer or in-amp active.
> > >
> > > For gains >= 4 it's the other way around: adi,buffer-disable is irrelevant.
> > >
> > > So it should be the driver to make sure all of it remains sane.
> > >
> > > But I did take a look on the datasheet and this actually seems wrong to
> > > be honest (the burnout stuff). Datasheet:
> > >
> > > "These currents can be used to verify that an external transducer is still operational before
> > > attempting to take measurements on that channel."
> > > "For normal operation, these burnout currents are turned off by writing a 0 to the BO bit
> > > in the configuration register."
> > >
> > > So I'll just drop the burnout property and maybe have it as a debugfs
> > > thing.
> >
> > For both of these properties, I think meaning assigned to them should
> > change (if kept). e.g. buffer-disable should not be a property that
> > disables the buffer, but instead tells software that the conditions for
> > disabling the buffer have been met by the hardware, and it is up to the
> > software to disable it if the gain is suitable. I assume that the buffer
>
> Maybe adi,low-source-impedance then? Disabling the input buffer is
Sure.
> basically handy when the source impedance is low enough so that we can
> disable the buffer and have no gain errors which allows for less power
> consumption and extend the input range by 30mV.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-11-27 18:16 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 10:19 [PATCH 0/6] iio: adc: drop platform data from some ADI ADC drivers Nuno Sá
2026-11-25 10:19 ` [PATCH 1/6] iio: adc: ad7887: fix on-chip reference enable logic Nuno Sá
2026-11-25 10:25 ` sashiko-bot
2026-11-26 10:41 ` Joshua Crofts
2026-11-25 10:19 ` [PATCH 2/6] iio: adc: ad7887: drop platform data support Nuno Sá
2026-11-25 10:35 ` Andy Shevchenko
2026-11-26 10:30 ` Nuno Sá
2026-11-25 10:19 ` [PATCH 3/6] iio: adc: ad7266: " Nuno Sá
2026-11-25 10:38 ` Andy Shevchenko
2026-11-26 10:28 ` Nuno Sá
2026-11-25 10:19 ` [PATCH 4/6] iio: adc: ad7791: " Nuno Sá
2026-11-25 10:40 ` Andy Shevchenko
2026-11-25 10:19 ` [PATCH 5/6] dt-bindings: iio: adc: add AD7793 and similar ADCs Nuno Sá
2026-11-25 10:28 ` sashiko-bot
2026-11-25 17:41 ` Conor Dooley
2026-11-26 12:24 ` Nuno Sá
2026-11-26 18:25 ` Conor Dooley
2026-11-27 11:04 ` Nuno Sá
2026-11-27 18:16 ` Conor Dooley [this message]
2026-11-25 10:19 ` [PATCH 6/6] iio: adc: ad7793: add firmware support and drop platform data Nuno Sá
2026-11-25 10:33 ` sashiko-bot
2026-11-25 10:43 ` Andy Shevchenko
2026-11-25 11:11 ` Nuno Sá
2026-11-26 2:00 ` Jonathan Cameron
2026-11-26 10:29 ` Nuno Sá
2026-11-26 2:00 ` Jonathan Cameron
2026-11-25 10:36 ` [PATCH 0/6] iio: adc: drop platform data from some ADI ADC drivers Arnd Bergmann
2026-11-25 11:01 ` 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=20261127-vertigo-smoking-fe2f90e28c88@spud \
--to=conor@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=arnd@arndb.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.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=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