[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aYiXjCpiMQ_h9Ao4@smile.fi.intel.com>
Date: Sun, 8 Feb 2026 16:02:52 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Marcelo Schmitt <marcelo.schmitt@...log.com>
Cc: linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
jic23@...nel.org, michael.hennerich@...log.com, nuno.sa@...log.com,
eblanc@...libre.com, dlechner@...libre.com, andy@...nel.org,
robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
corbet@....net, marcelo.schmitt1@...il.com
Subject: Re: [PATCH v8 8/8] iio: adc: ad4030: Support common-mode channels
with SPI offloading
On Fri, Feb 06, 2026 at 04:02:42PM -0300, Marcelo Schmitt wrote:
> AD4030 and similar devices can read common-mode voltage together with
> ADC sample data. When enabled, common-mode voltage data is provided in a
> separate IIO channel since it measures something other than the primary
> ADC input signal and requires separate scaling to convert to voltage
> units. The initial SPI offload support patch for AD4030 only provided
> differential channels. Now, extend the AD4030 driver to also provide
> common-mode IIO channels when setup with SPI offloading capability.
...
> -#define AD4030_CHAN_CMO(_idx, _ch) { \
> +#define __AD4030_CHAN_CMO(_idx, _ch, _offload) { \
> .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
> BIT(IIO_CHAN_INFO_SCALE), \
> .type = IIO_VOLTAGE, \
> .scan_index = (_idx), \
> .scan_type = { \
> .sign = 'u', \
> - .storagebits = 8, \
> + .storagebits = (_offload ? 32 : 8), \
> .realbits = 8, \
> - .endianness = IIO_BE, \
> + .endianness = (_offload ? IIO_CPU : IIO_BE), \
Hmm... This is interesting. Does it mean it's designed like this for any
offloaded SPI case? Wouldn't be better to follow the same endianess in both?
> }, \
> }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists