From: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
To: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Cc: sashiko-reviews@lists.linux.dev,
Marcelo Schmitt <marcelo.schmitt@analog.com>,
conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH v7 2/4] iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs
Date: Sat, 18 Jul 2026 22:39:19 +0100 [thread overview]
Message-ID: <20260718223919.0cf0475e@jic23-huawei> (raw)
In-Reply-To: <alvKfTS8Kj1MF3db@debian-BULLSEYE-live-builder-AMD64>
On Sat, 18 Jul 2026 15:48:29 -0300
Marcelo Schmitt <marcelo.schmitt1@gmail.com> wrote:
> TL;DR: Will switch to voltageY-voltageZ ABI.
>
> On 07/18, Jonathan Cameron wrote:
> > On Fri, 17 Jul 2026 13:38:07 -0300
> > Marcelo Schmitt <marcelo.schmitt1@gmail.com> wrote:
> >
> > > On 07/16, sashiko-bot@kernel.org wrote:
> > > > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > > > - [Medium] The `LTC2378_DIFF_CHANNEL` macro defines an IIO channel that is intended to be differential but lacks the `.differential = 1`, `.indexed = 1`, `.channel = 0`, and `.channel2 = 1` attributes.
> > > > --
> > > >
> > > > --- Patch [2]: [PATCH v7 2/4] iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs ---
> > > > commit 5710d5f25b45906977e2522567c1964b1d3219f8
> > > > Author: Marcelo Schmitt <marcelo.schmitt@analog.com>
> > > >
> > > > iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs
> > > >
> > > > This commit adds a new driver for the Analog Devices LTC2378-20 and
> > > > similar analog-to-digital converters.
> > > >
> > > > > diff --git a/drivers/iio/adc/ltc2378.c b/drivers/iio/adc/ltc2378.c
> > > > > new file mode 100644
> > > > > index 0000000000000..5600c820c7f45
> > > > > --- /dev/null
> > > > > +++ b/drivers/iio/adc/ltc2378.c
> > > > > @@ -0,0 +1,416 @@
> > > > [ ... ]
> > > > > +#define LTC2378_DIFF_CHANNEL(_sign, _real_bits, _storage_bits) \
> > > > > +{ \
> > > > > + .type = IIO_VOLTAGE, \
> > > > > + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
> > > > > + BIT(IIO_CHAN_INFO_SCALE), \
> > > > > + .scan_index = 0, \
> > > >
> > > > [Severity: Medium]
> > > > Does this macro need to set .differential = 1, .indexed = 1, .channel = 0,
> > > > and .channel2 = 1? The name suggests these are differential channels, but
> > > > without these attributes, the IIO ABI will expose them as single-ended
> > > > (e.g., in_voltage_raw instead of in_voltage0-voltage1_raw).
> > >
> > > For parts with multiple inputs and configurable differential channels (e.g.
> > > AD4130-8, MCP3561/2/4R, NAFE13388 [1, 2, 3]), the voltageY-voltageZ ABI helps
> > > clarifying what physical inputs make up a channel. For differential only parts,
> > > the ABI seems to be flexible by only requiring a 'consistent labeling' (either
> > > voltageY or voltageY-voltageZ IIUC). Will set the channel with the differential
> > > ABI if maintainers believe that's the best way to have it. Might slightly tweak
> > > the channel macros to keep .differential = 0 for pseudo-differential chips
> > > (e.g.LTC2369-18).
> >
> > Whilst I get your point on differential only cases not really requiring the
> > specification of two inputs, I think that does provide a simple indication
> > to users that they are differential channel.
> Agree. The first ADCs I've worked with were single-ended so having to provide
> the negative input when working with differential ones was something noticeable
> to me. Though, one applications engineer once called me out for the
> voltageY-voltageZ naming arguing that a differential channel provided only one
> input to his application and thus it should be labeled only 'voltageY' or even
> just 'voltage'. Despite understanding that argument, I share the opinion
> that an indication of differential channel is helpful. Anyways, besides the
> possibility for application to display channel names differently in user space,
> I see we now have .read_label so the whole discussion seems pointless.
>
> >
> > I would prefer that we make them 'look' like differential channels so make up
> > a suitable number for the negative side.
>
> Would it make sense to adjust the ABI doc to encourage the dual numbering for
> differential channels? So I don't fall the temptation of single index in the
> future :)
Yes. That would be good!
Thanks,
Jonathan
>
> Thanks,
> Marcelo
>
next prev parent reply other threads:[~2026-07-18 21:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 21:08 [PATCH v7 0/4] iio: adc: Add support for LTC2378 and similar ADCs Marcelo Schmitt
2026-07-16 21:09 ` [PATCH v7 1/4] dt-bindings: iio: adc: Add ltc2378 Marcelo Schmitt
2026-07-16 21:09 ` [PATCH v7 2/4] iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs Marcelo Schmitt
2026-07-16 21:28 ` sashiko-bot
2026-07-17 16:38 ` Marcelo Schmitt
2026-07-18 1:46 ` Jonathan Cameron
2026-07-18 18:48 ` Marcelo Schmitt
2026-07-18 21:39 ` Jonathan Cameron [this message]
2026-07-18 1:51 ` Jonathan Cameron
2026-07-16 21:10 ` [PATCH v7 3/4] iio: adc: ltc2378: Enable high-speed data capture Marcelo Schmitt
2026-07-16 21:24 ` sashiko-bot
2026-07-17 16:35 ` Marcelo Schmitt
2026-07-16 21:10 ` [PATCH v7 4/4] iio: adc: ltc2378: Enable triggered buffer " Marcelo Schmitt
2026-07-16 21:44 ` [PATCH v7 0/4] iio: adc: Add support for LTC2378 and similar ADCs Andy Shevchenko
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=20260718223919.0cf0475e@jic23-huawei \
--to=jonathan.cameron@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.com \
--cc=marcelo.schmitt@analog.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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