Re: [PATCH 2/2] iio: adc: ad_sigma_delta: support devices without RDY interrupt

From: Jonathan Cameron

Date: Fri Nov 20 2026 - 21:14:41 EST


On Fri, 20 Nov 2026 12:26:48 +0100
ILYAS NHASSE via B4 Relay <devnull+ilyas.nhasse.skf.com@xxxxxxxxxx> wrote:

> From: ILYAS NHASSE <ilyas.nhasse@xxxxxxx>
>
> The end of a conversion or of a calibration is detected with the DOUT/RDY
> interrupt, so a device whose DOUT/RDY pin is only wired to the SPI MISO
> line can't be used, although its status register reports the same event
> in its RDY bit.
>
> For devices with registers but without interrupt, wait for RDY in

without the interrupt wired

> ad_sigma_delta_single_conversion() and ad_sd_calibrate() by polling the
> status register, with the same timeouts as the interrupt-driven waits.
> As with the interrupt, the bus stays locked and CS asserted during the
> wait, and ad_sigma_delta_clear_pending_event() has drained any older
> result beforehand, so the RDY bit seen by the poll belongs to the
> operation just started. A timeout is reported as -ETIMEDOUT.
>
> The RDY interrupt is the only trigger source of the triggered buffer, so
> devm_ad_sd_setup_buffer_and_trigger() sets nothing up for these devices
> and they only support direct mode. Registerless devices still require
> the interrupt.
>
> Each poll is a SPI transfer, so poll every 20 ms: this delays the
> detection of the end of a conversion by at most one period, a fifth of
> a conversion at the AD7124 default output data rate of 10 SPS, while
> keeping the bus traffic, and the CPU time of PIO SPI transfers, low.
>
> Nothing changes for devices with an interrupt.

This is rather wordy. Perhaps try rewriting to cut that down
to text more likely to be read.
>
> Signed-off-by: ILYAS NHASSE <ilyas.nhasse@xxxxxxx>
In general seems fine to me.

Jonathan