This patch series adds support for LTC2378 and similar low noise, low power,
high speed, successive approximation register (SAR) ADCs. These ADCs are similar
among each other, varying mainly on the amount of precision bits, maximum sample
rate, and input configuration (either fully differential or pseudo-differential).
The first patch adds device tree documentation for LTC2378.
The second patch enables single-shot sample read with a GPIO connected
to the LTC2378 CNV pin.
The third patch extends IIO DMAengine buffer interface to make
sampling_frequency and sampling_frequency_available buffer attributes.
The fourth patch enables high-speed data captures with SPI offloading.
The setup is similar to AD4030, with a specialized PWM generator being used both
for SPI offload triggering and conversion start signaling.
The last support patch enables running buffered data captures without SPI offloading.
Even though these parts are somewhat similar to AD4000, the wiring configuration
for LTC parts is different as well as the available HDL for high speed sample
rate mode. Because of that, I propose creating a new device driver for
supporting LTC2378-like devices.
Specifications can be found at:
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/233818fa.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/236416fa.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/236418f.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/236716fa.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/236718f.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/236816f.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/236818f.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/236918fa.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/237016fa.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/237616fa.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/237618fa.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/237620fb.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/237716fa.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/237718fa.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/237720fb.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/237816fa.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/237818fa.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/237820fb.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/237918fb.pdf
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/238016fb.pdf
Some structures and variables are introduced earlier to reduce diff in latter patches.
The initial version of the LTC2378 driver was developed by Ioan-Daniel. Though,
despite of the many changes I made to the code, I've kept him as module author
to provide credit for his work.
Previous submissions:
v2: https://lore.kernel.org/linux-iio/cover.1779976379.git.marcelo.schmitt@analog.com/
v1: https://lore.kernel.org/linux-iio/cover.1779117444.git.marcelo.schmitt1@gmail.com/
Change log v2 -> v3:
[DT]
- Re-added device tree fallback compatibles for LTC2378 chips, now with options
to provide a single compatible string or a pair of single compatible string
plus a fallback string to a slower sample rate spec in case a driver for the
specific part is not found.
[IIO]
- Restricted LTC2378 dependency list to require GPIO
- Use datasheet terminology to indicate polarity/output code.
- Added missing block scope to IIO_DEV_ACQUIRE_DIRECT_MODE.
- Added missing static inline modifier to function stubs declared in header file.
- Fixed the evaluation loop conditions for CNV PWM and SPI Engine trigger PWM,
avoiding potential infinite loop if and CPU stall.
- Added comment to about initial PWM disable.
- Adjusted SPI offload setup initialization to not print error on a valid condition.
- Fully initialize IIO channel scan_type.
- Reworked to make offload support not imply all dependencies to be built in.
- Made sampling_frequency a buffer attribute.
- Made offload support not require DMA and other features to be built in.
- Now using same scan_type configuration for all use cases.
With best regards,
Marcelo
Marcelo Schmitt (5):
dt-bindings: iio: adc: Add ltc2378
iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs
iio: buffer: Extend DMAengine buffer interfaces to take extra sysfs
attributes
iio: adc: ltc2378: Enable high-speed data capture
iio: adc: ltc2378: Enable triggered buffer data capture
.../bindings/iio/adc/adi,ltc2378.yaml | 160 ++++++++
MAINTAINERS | 8 +
drivers/iio/adc/Kconfig | 30 ++
drivers/iio/adc/Makefile | 7 +
drivers/iio/adc/ad4000.c | 3 +-
drivers/iio/adc/ad4030.c | 3 +-
drivers/iio/adc/ad4691.c | 3 +-
drivers/iio/adc/ad4695.c | 2 +-
drivers/iio/adc/ad7380.c | 2 +-
drivers/iio/adc/ad7606_spi.c | 2 +-
drivers/iio/adc/ad7768-1.c | 3 +-
drivers/iio/adc/ad7944.c | 2 +-
drivers/iio/adc/ad_sigma_delta.c | 2 +-
drivers/iio/adc/ltc2378-lib-core.c | 50 +++
drivers/iio/adc/ltc2378-offload-buffer.c | 305 ++++++++++++++
drivers/iio/adc/ltc2378-triggered-buffer.c | 49 +++
drivers/iio/adc/ltc2378.c | 384 ++++++++++++++++++
drivers/iio/adc/ltc2378.h | 120 ++++++
.../buffer/industrialio-buffer-dmaengine.c | 19 +-
drivers/iio/dac/ad5791.c | 2 +-
drivers/iio/dac/ad8460.c | 2 +-
drivers/iio/dac/adi-axi-dac.c | 2 +-
include/linux/iio/buffer-dmaengine.h | 16 +-
23 files changed, 1151 insertions(+), 25 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ltc2378.yaml
create mode 100644 drivers/iio/adc/ltc2378-lib-core.c
create mode 100644 drivers/iio/adc/ltc2378-offload-buffer.c
create mode 100644 drivers/iio/adc/ltc2378-triggered-buffer.c
create mode 100644 drivers/iio/adc/ltc2378.c
create mode 100644 drivers/iio/adc/ltc2378.h
base-commit: a50909aa46dec46de3c73235fc15a7d6f763d996
--
2.53.0