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

From: Jonathan Cameron
Date: Sun Mar 24 2024 - 08:46:14 EST


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);
> > +};