Re: [PATCH v6 4/6] iio: pressure: dps310: add triggered buffer support
From: Jonathan Cameron
Date: Sun Aug 30 2026 - 20:48:42 EST
On 2026-08-25 12:06:12+03:00, Andy Shevchenko wrote:
> On Mon, Aug 24, 2026 at 11:12:01PM +0300, Rupesh Majhi wrote:
>
> > Add a triggered buffer in order to capture continuously on both channels
> > instead of one sysfs read at a time.
> >
> > Raw register value is not useful on its own, pressure has to go through
> > the compensation polynomial and needs a temperature reading. Report raw
> > in Pa with 1/1000 scale to keep full resolution in the buffer without
> > changing what the existing processed attribute reports.
> >
> > Raw and processed reads return -EBUSY while buffer is on, so does any
> > reconfiguration.
>
> ...
>
> > +struct dps310_scan {
> > + s32 channels[2];
> > + aligned_s64 ts;
> > +};
>
> Wondering if using macro here would make sense...
Hi Andy,
Do you mean introducing a new one or using the buffer ones? I'd
rather keep explicit structures where possible. They are much easier
to reead as they make the data layout explicit, including the holes
(as long as folk remember their c structure alignments!)
- no holes here obviously!
We only introduced the IIO_BUFFER macros to cover the cases we
can't represent as a structure because the timestamp moves
around as the number of channels enabled changes. Necessary
trick to reduce the size of the kfifos.
Jonathan