Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: adc: ad7124: support boards without RDY interrupt
@ 2026-11-20 11:26 ILYAS NHASSE via B4 Relay
  2026-11-20 11:26 ` [PATCH 1/2] dt-bindings: iio: adc: adi,ad7124: make interrupts optional ILYAS NHASSE via B4 Relay
  2026-11-20 11:26 ` [PATCH 2/2] iio: adc: ad_sigma_delta: support devices without RDY interrupt ILYAS NHASSE via B4 Relay
  0 siblings, 2 replies; 6+ messages in thread
From: ILYAS NHASSE via B4 Relay @ 2026-11-20 11:26 UTC (permalink / raw)
  To: Nuno Sá, Michael Hennerich, Jonathan Cameron, David Lechner,
	Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Marcelo Schmitt
  Cc: linux, linux-iio, devicetree, linux-kernel, ILYAS NHASSE

Boards may wire the AD7124 DOUT/RDY pin to the SPI MISO line only, for
instance when the ADC sits behind a digital isolator that carries just
the SPI signals. Such boards can't use the driver today: the binding
requires an interrupt, and the sigma-delta core can't probe without one.

The end of a conversion or calibration is also reported by the RDY bit
of the status register. Analog Devices' no-OS driver waits for AD7124
conversions and calibrations this way (ad7124_wait_for_conv_ready()).

Patch 1 makes the interrupt optional in the AD7124 binding.
Patch 2 lets the sigma-delta core poll the RDY bit when there is no
interrupt, for single conversions and calibrations. These devices then
only support direct mode, as the RDY interrupt is the only trigger of
the triggered buffer. No AD7124 driver change is needed.

The polling applies to every device with registers, but only the AD7124
binding is relaxed: the other bindings still require the interrupt, so
boards using them are not affected.

Open questions:
- Poll period: 20 ms, a fifth of a conversion at the AD7124 default
  10 SPS. On our board the SPI clock runs at about 6 kHz through the
  isolator and the controller uses PIO, so each status read costs about
  2.7 ms of CPU time and the period directly sets the CPU load during a
  conversion.
- Should polling rather be opt-in per driver, with a flag in
  struct ad_sigma_delta_info?

Tested on a TI J721E based board with four AD7124-8 on one SPI bus
behind an isolator, without RDY interrupt: direct reads of all channels
with an equivalent implementation on a v6.12 based kernel. The polled
calibration path is build-tested only.

---
ILYAS NHASSE (2):
      dt-bindings: iio: adc: adi,ad7124: make interrupts optional
      iio: adc: ad_sigma_delta: support devices without RDY interrupt

 .../devicetree/bindings/iio/adc/adi,ad7124.yaml    |  1 -
 drivers/iio/adc/ad_sigma_delta.c                   | 47 +++++++++++++++++++---
 2 files changed, 41 insertions(+), 7 deletions(-)
---
base-commit: 7d80b4b383bc53b48abd3a30ca4a91cdab568bfa
change-id: 20261030-ad7124-no-irq-ded325dea4ac

Best regards,
--  
ILYAS NHASSE <ilyas.nhasse@skf.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-20 17:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 11:26 [PATCH 0/2] iio: adc: ad7124: support boards without RDY interrupt ILYAS NHASSE via B4 Relay
2026-11-20 11:26 ` [PATCH 1/2] dt-bindings: iio: adc: adi,ad7124: make interrupts optional ILYAS NHASSE via B4 Relay
2026-11-20 17:46   ` Conor Dooley
2026-11-20 11:26 ` [PATCH 2/2] iio: adc: ad_sigma_delta: support devices without RDY interrupt ILYAS NHASSE via B4 Relay
2026-11-20 11:45   ` sashiko-bot
2026-11-20 12:24   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox