Re: [PATCH 3/3] iio: adc: ad4130: add new supported parts

From: Jonathan Cameron

Date: Sat Mar 07 2026 - 12:01:32 EST


On Sat, 7 Mar 2026 10:27:41 -0600
David Lechner <dlechner@xxxxxxxxxxxx> wrote:

> On 3/2/26 6:51 AM, Andy Shevchenko wrote:
> > On Sat, Feb 28, 2026 at 09:39:04AM -0300, Jonathan Santos wrote:
> >> Add support for AD4129-4/8, AD4130-4, and AD4131-4/8 variants.
> >>
>
> ...
>
> >
> >> + /* Triggered buffer data structure */
> >> + struct {
> >> + u32 channels[AD4130_MAX_CHANNELS];
> >> + s64 timestamp;
> >
> > Use aligned_s64 type...
> >
> >> + } scan __aligned(8);
> >
> > ...instead of this.
> >
>
> This is used with SPI, so it actually needs to be:
>
> IIO_DECLARE_DMA_BUFFER_WITH_TS(u32, channels, AD4130_MAX_CHANNELS);
Whilst you are correct, that reasoning is partial.

We could have marked it as sufficiently aligned.
The buffer part make sense because we may have only a few channels enabled
so the timestamp may be much earlier in memory than the structure suggests.

Thanks,

J