[PATCH v2 0/7] iio: adc: Add support for AD4170 series of ADCs

Marcelo Schmitt
2025-04-28T12:28:01Z

This patch set adds support for Analog Devices AD4170 and similar sigma-delta ADCs.

Patch 1 adds device tree documentation for the parts.
Patch 2 adds basic device support.
Patch 3 adds support for buffered ADC reading.
Patch 4 adds clock provider support
Patch 5 adds GPIO controller support.
Patch 6 adds internal temperature sensor support.
Patch 7 adds support for external RTD and bridge circuit sensors.

I believe to have updated the series according to all suggestions offered during
v1 review. The exceptions should be the IOVDD (discussed below) and regmap bulk
access which I decided to replace by a custom regmap_read/write implementation
instead.

Thank you for providing your insights and help.

Change log v1 -> v2

[IIO driver changes]
- Call gpio_set() at begining of gpio_direction_output() instead of at the end of it.
- Return -EPERM if try to set a GPIO configured for input.
- Now locking on state mutex before setting output GPIO values.
- Used gpiochio init_valid_mask() to only init available GPIOs.
- Replaced 3 regmap configs by regmap with custom reg_read/write implementation.
- Improved to support more than one external sensor connected.
- A few other minor improvements.

Previously, I thought IOVDD supply could be optional but it seems to be required.
I have only remote access to a setup with EVAL-AD4170-4 but am pretty sure the
link in the eval board was set to provide 3.3V to IOVDD pin.
Datasheet sais 'This supply sets the interface logic levels on the SPI interface
and powers an internal regulator for operation of the digital processing.'
Since IOVDD supply will presumably be enabled, I kept reading it's voltage
even though ADC channels might not use that info.

[device tree changes]
- Referenced adc.yaml from sensor-node.
- Merged property descriptions to reduce doc duplication.
- Every child node type is now in the example.
- Better described sensor-type property with a list of possible types.
- Updated adi,excitation-pins description to cover a use case I had overlooked.
- Added default to interrupt-names and to clock-names.
- Added support for clock-output-names
- Dropped '|' from descriptions when not needed.
- Added extra example

Link to v1: https://lore.kernel.org/linux-iio/cover.1744200264.git.marcelo.schmitt@analog.com/

Marcelo

Ana-Maria Cusco (1):
iio: adc: Add basic support for AD4170

Marcelo Schmitt (6):
dt-bindings: iio: adc: Add AD4170
iio: adc: ad4170: Add support for buffered data capture
iio: adc: ad4170: Add clock provider support
iio: adc: ad4170: Add GPIO controller support
iio: adc: ad4170: Add support for internal temperature sensor
iio: adc: ad4170: Add support for weigh scale and RTD sensors

.../bindings/iio/adc/adi,ad4170.yaml | 554 ++++
MAINTAINERS | 8 +
drivers/iio/adc/Kconfig | 16 +
drivers/iio/adc/Makefile | 1 +
drivers/iio/adc/ad4170.c | 2846 +++++++++++++++++
5 files changed, 3425 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad4170.yaml
create mode 100644 drivers/iio/adc/ad4170.c

base-commit: 1c2409fe38d5c19015d69851d15ba543d1911932
--
2.47.2