devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/7] iio: adc: Add support for AD4170 series of ADCs
@ 2025-04-09 12:23 Marcelo Schmitt
  2025-04-09 12:24 ` [PATCH v1 1/7] dt-bindings: iio: adc: Add AD4170 Marcelo Schmitt
                   ` (6 more replies)
  0 siblings, 7 replies; 27+ messages in thread
From: Marcelo Schmitt @ 2025-04-09 12:23 UTC (permalink / raw)
  To: linux-iio, devicetree, linux-kernel
  Cc: jic23, lars, Michael.Hennerich, dlechner, nuno.sa, andy, robh,
	krzk+dt, conor+dt, marcelo.schmitt1

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

I've arranged the patches so that the first ones comprise changes more typical
of IIO device drivers while the last one has the most uncommon changes.
I believe to have applied all suggestions to the RFC version.

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.

For context, an initial version of the ad4170 driver was developed by
Ana-Maria Cusco. I then picked that up, created dt docs, and did several
improvements to the driver.

This first version has so many changes compared to the RFC version that it's not
worth listing them all. The most significant one, though, are listed below.

Change log RFC -> v1

[IIO driver changes]
- Split off extra features into smaller additional patches.
- No longer pushing timestamp data to buffers.
- Used iio_for_each_active_channel() to iterate over channels in trigger handler.
- Correctly implemented incomplete/broken usage of SPI optimized messages.
- No longer setting interrupt direction in driver.
- Register names, register field names, and names of constants for register
  fields now follow an established pattern.
- Data ready interrupt config now set according to interrupt-names dt property.
- Added scan_mask to validate chan 0 is enabled when multiple chans are enabled.
- Added a comment explaining the reason to disable all channel at buffer_predisable().
- Complemented comment about channel 0 being required to be enabled when more
  than one channel is enabled.
- New GPIO controller support patch.
- New internal temperature sensor support patch.

There are some places where I used find_closest() to match/verify values from
dt. On the last patch, I added ad4170_find_table_index() to avoid find_closest()
but may use something else if there are any generic helper for such thing.

[device tree changes]
- Dropped adi,ad4170.h. All dt documentation is now in adi,ad4170.yaml.
- Described external bridge circuits and RTD sensors as specialized channels
  with specific properties for excitation control.
- Bridge circuit excitation properties are now sensor-node only.
- Added compatibles for 2 more similar chips.
- Added ldac-gpios.
- Dropped adi,dig-aux1, DIG_AUX1 now set according to Data Ready interrupt choice.
- Dropped adi,dig-aux2, DIG_AUX2 now set according to LDAC GPIO presence.
- Dropped adi,sync-option, SYNC_CTRL will only of be set for multi-device sync.
- Dropped adi,burnout-current-nanoamp since open wire detection should be a runtime config.
- Complemented adi,buffered-pos/neg description with possible reason to not enable them.
- adi,gpion-power-down-switch renamed to adi,power-down-switch-pin is now a
  sensor-node only prop.

About the bridge power-down-switch pins, it was mentioned that maybe they could
be described as regulators that the bridge circuit would consume. One
complication of that approach is that the AD4170 powerdown switches close to
AVSS/GND and that doesn't help determining regulator maximum voltage. It may
also be desired to control the power switches at runtime to save power by
closing the power down switches when the bridge would not be in use. Because of
that, I have removed pw-down switch props from the dt-binding.

Not sure what to do about the various possible multiplexed inputs to the ADC.
Even though the IIO driver doesn't handle all of them, I'm keeping those since
dt-bindings are intended to be OS agnostic and we are expected to make bindings
complete.

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          |  527 +++
 MAINTAINERS                                   |    8 +
 drivers/iio/adc/Kconfig                       |   16 +
 drivers/iio/adc/Makefile                      |    1 +
 drivers/iio/adc/ad4170.c                      | 2817 +++++++++++++++++
 5 files changed, 3369 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


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

end of thread, other threads:[~2025-04-14 18:42 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-09 12:23 [PATCH v1 0/7] iio: adc: Add support for AD4170 series of ADCs Marcelo Schmitt
2025-04-09 12:24 ` [PATCH v1 1/7] dt-bindings: iio: adc: Add AD4170 Marcelo Schmitt
2025-04-11 15:47   ` Rob Herring
2025-04-12 16:07   ` Jonathan Cameron
2025-04-09 12:24 ` [PATCH v1 2/7] iio: adc: Add basic support for AD4170 Marcelo Schmitt
2025-04-10  6:31   ` Nuno Sá
2025-04-11 15:38     ` Marcelo Schmitt
2025-04-12 16:19       ` Jonathan Cameron
2025-04-12 18:26         ` Andy Shevchenko
2025-04-14 14:01         ` Marcelo Schmitt
2025-04-12 16:47   ` Jonathan Cameron
2025-04-14 12:13     ` Marcelo Schmitt
2025-04-14 18:42       ` Jonathan Cameron
2025-04-09 12:25 ` [PATCH v1 3/7] iio: adc: ad4170: Add support for buffered data capture Marcelo Schmitt
2025-04-10  9:32   ` Nuno Sá
2025-04-09 12:25 ` [PATCH v1 4/7] iio: adc: ad4170: Add clock provider support Marcelo Schmitt
2025-04-10  9:40   ` Nuno Sá
2025-04-09 12:25 ` [PATCH v1 5/7] iio: adc: ad4170: Add GPIO controller support Marcelo Schmitt
2025-04-10  9:53   ` Nuno Sá
2025-04-14 14:11     ` Marcelo Schmitt
2025-04-14 14:24   ` Andy Shevchenko
2025-04-09 12:26 ` [PATCH v1 6/7] iio: adc: ad4170: Add support for internal temperature sensor Marcelo Schmitt
2025-04-10 10:03   ` Nuno Sá
2025-04-09 12:26 ` [PATCH v1 7/7] iio: adc: ad4170: Add support for weigh scale and RTD sensors Marcelo Schmitt
2025-04-10 10:39   ` Nuno Sá
2025-04-14 15:38     ` Marcelo Schmitt
2025-04-14 17: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;
as well as URLs for NNTP newsgroup(s).