Re: [PATCH 2/2] iio: adc: Add support for AD4000

Jonathan Cameron
2024-03-24T12:46:02Z

On Sat, 23 Mar 2024 16:53:17 -0500

> > +
> > + /*
> > + * DMA (thus cache coherency maintenance) requires the
> > + * transfer buffers to live in their own cache lines.
> > + */
> > + union {
> > + struct {
> > + u8 sample_buf[4];
> > + s64 timestamp;
>
> Usually we see __aligned(8) applied to the timestamp (I'm guessing
> some archs need it?)
>
Good spot. Yes, x86_32 is the one that we most commonly refer to for this.
It aligns s64 to only 32 bits whereas IIO ABI is always naturally aligned.

> > + } scan;
> > + u8 d8[2];
> > + } data __aligned(IIO_DMA_MINALIGN);
> > +};