RE: [PATCH 6/7] iio: imu: adis16607: Add FIFO-based buffered capture
From: Sabau, Radu bogdan
Date: Wed Dec 02 2026 - 06:54:06 EST
> -----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.
>
> > + enable_irq(adis->spi->irq);
> > +
> > + return 0;
> > +}
>
> >
> > /*
> > @@ -814,6 +1158,7 @@ static const struct adis_data adis16607_data = {
> > .diag_stat_size = 2,
> > .prod_id_reg = ADIS16607_REG_DEV_ID,
> > .prod_id = 0x6000,
> > + .has_fifo = true,
> > .unmasked_drdy = true,
> > .init = adis16607_init,
> > .self_test = adis16607_self_test,
> > @@ -972,7 +1317,19 @@ static int adis16607_probe(struct spi_device
> *spi)
> > indio_dev->info = &adis16607_info;
> > indio_dev->modes = INDIO_DIRECT_MODE;
> >
> > + if (!spi->irq)
> > + return dev_err_probe(dev, -EINVAL, "interrupt is required\n");
>
> The driver is upstream without that requirement. We should not add it now as
> I assume it works to some degree without it? Just modify the reported
> channels
> etc to have it support current functionality if no irq. That probably means
> multiple iio_info, possibly channels etc.
You are right, I did not think about boards that do not wire the interrupt.
In v2 the interrupt will be optional: without one no buffer is set up and the
driver behaves as it does now.
>
>
> > +
> > + /* 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.