From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: Conor Dooley <conor@kernel.org>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, jic23@kernel.org,
nuno.sa@analog.com, Michael.Hennerich@analog.com,
dlechner@baylibre.com, andy@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v1 1/4] dt-bindings: iio: adc: Add ltc2378
Date: Mon, 18 May 2026 15:42:05 -0300 [thread overview]
Message-ID: <agtdfXdUR-zwtFOe@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20260518-trapped-gauze-ada279af89fc@spud>
Hi Conor,
On 05/18, Conor Dooley wrote:
> On Mon, May 18, 2026 at 12:21:01PM -0300, Marcelo Schmitt wrote:
> > From: Marcelo Schmitt <marcelo.schmitt@analog.com>
> >
> > Document how to describe LTC2378-20 and similar ADCs in device tree.
> >
> > Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> > ---
...
> > +properties:
> > + compatible:
> > + oneOf:
> > + - enum:
> > + - adi,ltc2338-18
> > + - adi,ltc2369-18
> > + - adi,ltc2370-16
> > + - adi,ltc2379-18
> > + - adi,ltc2380-16
> > + - items:
> > + - enum:
> > + - adi,ltc2364-18
> > + - adi,ltc2364-16 # fallback compatible
> > + - items:
> > + - enum:
> > + - adi,ltc2367-18
> > + - adi,ltc2367-16 # fallback compatible
> > + - items:
> > + - enum:
> > + - adi,ltc2368-18
> > + - adi,ltc2368-16 # fallback compatible
> > + - items:
> > + - enum:
> > + - adi,ltc2376-18
> > + - adi,ltc2376-20
> > + - adi,ltc2376-16 # fallback compatible
> > + - items:
> > + - enum:
> > + - adi,ltc2377-18
> > + - adi,ltc2377-20
> > + - adi,ltc2377-16 # fallback compatible
> > + - items:
> > + - enum:
> > + - adi,ltc2378-18
> > + - adi,ltc2378-20
> > + - adi,ltc2378-16 # fallback compatible
>
> All of these are wrong.
>
> Firstly, your "fallback" setups don't work, because they only permit a
> single compatible. Secondly, if they did work, you still need to define
> the fallback compatible in isolation for it to be permitted for use when
> it isn't a fallback.
> And thirdly, your driver appears to show that these devices aren't
> actually compatible at all, given there's unique match data for each
> one.
...
>
> Why do you have fallbacks here? Is it because a limited set of channels
> could be used in the fallback case? At the very least, the rationale for
> fallbacks should be explained.
>
Some devices can be grouped by main number (e.g. ltc2378-16, -18, -20) and
those vary only on the amount of precision bits. I initially thought we could
fallback to reading only 16 or 18 bits if a driver compatible with ltc2378-20 is
not found. Though, I now realize that won't work because the less significant
bits would be missing which would compromise scaling the data to milli volts.
Will make this a unique match list (no separate items lists, no fallbacks).
...
> > +
> > +additionalProperties: false
>
> As sashiko pointed out, this is not correct if you want to permit spi
> properties other than spi-max-frequency (although I could definitely see
> how this would be correct).
Ack, switching to 'unevaluatedProperties: false'.
Thanks,
Marcelo
next prev parent reply other threads:[~2026-05-18 18:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 15:20 [PATCH v1 0/4] iio: adc: Add support for LTC2378 and similar ADCs Marcelo Schmitt
2026-05-18 15:21 ` [PATCH v1 1/4] dt-bindings: iio: adc: Add ltc2378 Marcelo Schmitt
2026-05-18 15:29 ` sashiko-bot
2026-05-18 17:06 ` Conor Dooley
2026-05-18 18:42 ` Marcelo Schmitt [this message]
2026-05-18 15:21 ` [PATCH v1 2/4] iio: adc: Add support for LTC2378-20 and similar ADCs Marcelo Schmitt
2026-05-18 15:51 ` sashiko-bot
2026-05-20 16:04 ` Jonathan Cameron
2026-05-18 15:22 ` [PATCH v1 3/4] iio: adc: ltc2378: Enable high-speed data capture Marcelo Schmitt
2026-05-18 16:19 ` sashiko-bot
2026-05-20 16:27 ` Jonathan Cameron
2026-05-20 17:31 ` Marcelo Schmitt
2026-05-20 18:58 ` Jonathan Cameron
2026-05-18 15:22 ` [PATCH v1 4/4] iio: adc: ltc2378: Enable triggered buffer " Marcelo Schmitt
2026-05-20 16:32 ` 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=agtdfXdUR-zwtFOe@debian-BULLSEYE-live-builder-AMD64 \
--to=marcelo.schmitt1@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=conor@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=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