linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Add support for AD4062 device family
@ 2025-10-13  7:27 Jorge Marques
  2025-10-13  7:27 ` [PATCH 1/7] dt-bindings: iio: adc: Add adi,ad4062 Jorge Marques
                   ` (6 more replies)
  0 siblings, 7 replies; 31+ messages in thread
From: Jorge Marques @ 2025-10-13  7:27 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	David Lechner, Nuno Sá, Andy Shevchenko, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet
  Cc: linux-iio, devicetree, linux-kernel, linux-doc, Jorge Marques

The AD4060/AD4062 are versatile, 16-bit/12-bit, successive approximation
register (SAR) analog-to-digital converter (ADC).

The device uses a 2-wire I3C interface. The device simplifies acquisition
by providing 4-bytes in the register map, signal-extending the sample
reading accordingly.

The device has autonomous monitoring capabilities, that are exposed as
IIO events. Since register access requires leaving the monitoring state
and returning, any device access exits monitoring mode, disabling the
IIO event.

The device contains two optional outputs:

- gp0: ADC conversion ready signal on the falling edge.
       The user should either invert the signal or set the IRQ as falling edge.
- gp1: Threshold either event interrupt on the rising edge.

The devices utilizes PM to enter the low power mode.

The devices datasheet:
https://www.analog.com/media/en/technical-documentation/data-sheets/ad4060.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ad4062.pdf

The monitoring capabilities, I3C protocol, and multiple GPIOs were the
decision factor to have a standalone driver for this device family. The
device is expected to work with any I3C Bus. I tested the device with
with off-the-shelf I3C controllers STM32H7 (baremetal only) and the
open-source ADI I3C Controller (with Linux driver):
https://analogdevicesinc.github.io/hdl/library/i3c_controller/index.html
ADI I3C Controller lore:
https://lore.kernel.org/linux-i3c/175788312841.382502.16653824321627644225.b4-ty@bootlin.com/

The series is divided in 3 blocks, adding:
- The base driver.
- An software IIO trigger: captures samples continuously.
- IIO events support: exposes the device's threshold monitoring
  capability.

The device internal clock register is exposed twice, as
sampling_frequency and events/sampling_frequency, storing in distinct 
state variables, since the usage (burst averaging mode and monitor mode)
cannot be executed at the same time.

Non-implemented features:

- Averaging mode: Similar to burst averaging mode used in the
  oversampling, but requiring a sequence of CNV triggers for each
  conversion.
- Trigger mode: Similar to monitor mode used in the monitoring mode, but
  exits to configuration mode on event.

This device is almost identical to AD4052 family, but I decided to
submit the AD4062 before re-submitting AD4052 to better contextualize
the focus of the device family (high latency, medium-speed protocol,
low-power autonomous monitoring rather than high-throughput
acquisition).

Depending on the resolution of this driver, the AD4052 family may be
added to it, by splitting into ad4062_i3c.c, ad4062_spi.c,
ad4062_core.c, or as a standalone driver ad4052.c.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
---
Jorge Marques (7):
      dt-bindings: iio: adc: Add adi,ad4062
      docs: iio: New docs for ad4062 driver
      iio: adc: Add support for ad4062
      docs: iio: ad4062: Add IIO Trigger support
      iio: adc: ad4062: Add IIO Trigger support
      docs: iio: ad4062: Add IIO Events support
      iio: adc: ad4062: Add IIO Events support

 .../devicetree/bindings/iio/adc/adi,ad4062.yaml    |   83 ++
 Documentation/iio/ad4062.rst                       |  138 ++
 MAINTAINERS                                        |    8 +
 drivers/iio/adc/Kconfig                            |   13 +
 drivers/iio/adc/Makefile                           |    1 +
 drivers/iio/adc/ad4062.c                           | 1375 ++++++++++++++++++++
 6 files changed, 1618 insertions(+)
---
base-commit: b469ad0b561478045c72d74cdf857171f1cf1c40
change-id: 20251011-staging-ad4062-20d897d33ab6

Best regards,
-- 
Jorge Marques <jorge.marques@analog.com>


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

end of thread, other threads:[~2025-12-06 16:31 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-13  7:27 [PATCH 0/7] Add support for AD4062 device family Jorge Marques
2025-10-13  7:27 ` [PATCH 1/7] dt-bindings: iio: adc: Add adi,ad4062 Jorge Marques
2025-10-13 19:50   ` Conor Dooley
2025-10-26 16:35     ` Jorge Marques
2025-10-18 15:11   ` Jonathan Cameron
2025-10-26 16:37     ` Jorge Marques
2025-10-13  7:28 ` [PATCH 2/7] docs: iio: New docs for ad4062 driver Jorge Marques
2025-10-18 15:21   ` Jonathan Cameron
2025-10-28 15:31     ` Jorge Marques
2025-11-02 12:37       ` Jonathan Cameron
2025-11-03 10:19         ` Jorge Marques
2025-11-03 12:22           ` Jorge Marques
2025-11-09 12:16             ` Jonathan Cameron
2025-11-09 12:31           ` Jonathan Cameron
2025-10-13  7:28 ` [PATCH 3/7] iio: adc: Add support for ad4062 Jorge Marques
2025-10-18 16:10   ` Jonathan Cameron
2025-11-23 19:48     ` Jorge Marques
2025-11-24  7:43       ` Andy Shevchenko
2025-11-24  8:57         ` Jorge Marques
2025-11-24  9:10           ` Andy Shevchenko
2025-12-06 16:31             ` Jonathan Cameron
2025-11-24  9:11           ` Andy Shevchenko
2025-11-24  9:24             ` Jorge Marques
2025-10-13  7:28 ` [PATCH 4/7] docs: iio: ad4062: Add IIO Trigger support Jorge Marques
2025-10-13  7:28 ` [PATCH 5/7] iio: adc: " Jorge Marques
2025-10-18 16:14   ` Jonathan Cameron
2025-11-23 19:48     ` Jorge Marques
2025-10-13  7:28 ` [PATCH 6/7] docs: iio: ad4062: Add IIO Events support Jorge Marques
2025-10-13  7:28 ` [PATCH 7/7] iio: adc: " Jorge Marques
2025-10-18 16:26   ` Jonathan Cameron
2025-11-23 19:48     ` Jorge Marques

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).