mbox series

[0/2] Add support for AD4000 series

Message ID cover.1711131830.git.marcelo.schmitt@analog.com (mailing list archive)
Headers show
Series Add support for AD4000 series | expand

Message

Marcelo Schmitt March 22, 2024, 10:04 p.m. UTC
This series adds support for high-speed, high-precision AD4000 series of SAR ADCs.

Most uncommon things about this set are:
1) These devices have the same SPI (Strange Peripheral Interface) as AD7944
devices, which has been documented in ad7944.rst [1].
The device tree description for SPI connections and mode can be the same as of
ad7944 adi,spi-mode [2].
Because ad4000 driver does not currently support daisy-chain mode, I simplified
things a little bit. If having a more complete doc is preferred, I'm fine
changing to that.

[1]: https://lore.kernel.org/linux-iio/20240313-mainline-ad7944-doc-v1-2-7860416726e4@baylibre.com/
[2]: https://lore.kernel.org/linux-iio/20240304-ad7944-mainline-v5-1-f0a38cea8901@baylibre.com/

2) Differently from AD7944, AD4000 devices have a configuration register to
toggle some features. For instance, turbo mode is set through configuration
register rather than an external pin. This simplifies hardware connections,
but then requires software interface. So, additional ABI being proposed 
in sysfs-bus-iio-adc-ad4000. The one I'm most in doubt about is 
span_compression_en which affects the in_voltageY_scale attribute.
That might be instead supported by providing _scale_available and allowing write
to _scale. Anyway, let me know how bad those look like :)

Thanks,
Marcelo

Marcelo Schmitt (2):
  dt-bindings: iio: adc: Add AD4000
  iio: adc: Add support for AD4000

 .../ABI/testing/sysfs-bus-iio-adc-ad4000      |  36 +
 .../bindings/iio/adc/adi,ad4000.yaml          | 151 ++++
 MAINTAINERS                                   |   9 +
 drivers/iio/adc/Kconfig                       |  12 +
 drivers/iio/adc/Makefile                      |   1 +
 drivers/iio/adc/ad4000.c                      | 666 ++++++++++++++++++
 6 files changed, 875 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-adc-ad4000
 create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad4000.yaml
 create mode 100644 drivers/iio/adc/ad4000.c