Re: [PATCH 6/7] iio: imu: adis16607: Add FIFO-based buffered capture

From: Jonathan Cameron

Date: Fri Dec 04 2026 - 17:51:27 EST


On Wed, 2 Dec 2026 11:53:43 +0000
"Sabau, Radu bogdan" <radu.sabau@xxxxxxxxxx> wrote:

> > -----Original Message-----
> > From: Jonathan Cameron <jic23@xxxxxxxxxx>
> > Sent: Sunday, November 29, 2026 12:00 AM
>
> ...
>
> > > + ret = __adis_write_reg_16(adis, ADIS16607_REG_USER_FIFO_CFG,
> > > + threshold & ADIS16607_FIFO_THR_MASK);
> > > + if (ret)
> > > + return ret;
> > > +
> > > + /*
> > > + * The device cannot mask DEV_NOK for us: unrouting it leaves the pin
> > > + * on its weak pull-up, which reads as asserted. Mask it on the host.
> > > + */
> >
> > Ah. This is the comment we need for the earlier patches. Is that generally
> > true for all the kfifo supported devices, or should we be using some sort
> > of flag to let the adis helper know if this is required?
>
> It is the same for all of them so far. The adis16475 FIFO variants and this
> driver set unmasked_drdy, which adislib uses for parts whose pin cannot
> be masked in the device.
> The interrupts are level triggered, so nothing is lost while masked on the host.
>
> The helper relied on this without saying so. In v2 its function comment will
> state that it is for such parts, and the commit messages of patches 2 and 4
> will give the reason.
> I did not add a device-side path, as there is no FIFO part that can mask in
> the device to test it on.
>
> Would you also like the helper to refuse to set up when unmasked_drdy
> is not set? I left it out to avoid code that cannot run today, but it is a
> three-line check.

If there is no path to it running, then probably not needed. However
if you feel it acts as convenient documentation to have the check, then
go ahead.

>
> >
> > > + enable_irq(adis->spi->irq);

>
> >
> >
> > > +
> > > + /* The core's default; the device watermark follows buffer/watermark
> > */
> > > + st->fifo_watermark = 1;
> > > +
> > > st->adis.ops = &adis16607_ops;
> > > + /*
> > > + * DEV_NOK is the OR of the DIAG_STAT flags and stays high until
> > > + * DIAG_STAT is read. Use a level interrupt so a flag raised while it
> > > + * is already high is not lost.
> > > + */
> > > + st->adis.irq_flag = IRQF_TRIGGER_HIGH;
> > For a modern driver explain why we don't get this from the firmware.
> >
>
> No good reason, other than DEV_NOK being active high.
> In v2 I will take the type from the interrupt specifier in firmware, falling
> back to level high if there is none.

For modern driver, don't have that fallback. If firmware is broken
we don't generally guess how to fix it. The problem with assuming
polarity has always been folk using not gates as cheap level shifters
when the sensor and SoC voltages are different.

Jonathan

>