[PATCH v2 0/4] iio: adc: Add support for LTC2378 and similar ADCs

Marcelo Schmitt posted 4 patches 1 week, 3 days ago
.../bindings/iio/adc/adi,ltc2378.yaml         | 118 +++++
MAINTAINERS                                   |   8 +
drivers/iio/adc/Kconfig                       |  22 +
drivers/iio/adc/Makefile                      |   2 +
drivers/iio/adc/ltc2378-offload-buffer.c      | 296 ++++++++++++
drivers/iio/adc/ltc2378.c                     | 454 ++++++++++++++++++
drivers/iio/adc/ltc2378.h                     | 113 +++++
7 files changed, 1013 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ltc2378.yaml
create mode 100644 drivers/iio/adc/ltc2378-offload-buffer.c
create mode 100644 drivers/iio/adc/ltc2378.c
create mode 100644 drivers/iio/adc/ltc2378.h
[PATCH v2 0/4] iio: adc: Add support for LTC2378 and similar ADCs
Posted by Marcelo Schmitt 1 week, 3 days ago
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 initial support patch enables single-shot sample read with a GPIO connected
to the CNV pin.

The second support 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.

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.

Link to v1: https://lore.kernel.org/linux-iio/cover.1779117444.git.marcelo.schmitt1@gmail.com/

Change log v1 -> v2:
[DT]
- Use unevaluatedProperties:false with spi-peripheral-props.yaml reference/include.
- Use unique compatibles (no fallbacks).
[IIO]
- Added missing includes for LTC2378 driver.
- Added waiting time required before reading back LTC2378 conversion data.
- Fixed voltage regulator read error path.
- Properly right-aligned sample data.
- Set loop count to prevent CPU stall when calculating PWM parameters.
- Hardcode set specific offload supported amount of data element bits.
- Fixed devm_spi_offload_get() error path.
- Dropped device ID table and simplified chip specific information keeping.
- Using named device_id data initializers.
- Use bool for output code type distinction.
- Initialize init scan_type according to buffer selection.
- Added scope for IIO_DEV_ACQUIRE_DIRECT_MODE usage.
- Offload attributes now are channel based instead of device based.
- Use IIO_CHAN_SOFT_TIMESTAMP directly on right hand of assignment.
- Wrapped comments close to 80 columns.
- Organized includes.


Marcelo Schmitt (4):
  dt-bindings: iio: adc: Add ltc2378
  iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs
  iio: adc: ltc2378: Enable high-speed data capture
  iio: adc: ltc2378: Enable triggered buffer data capture

 .../bindings/iio/adc/adi,ltc2378.yaml         | 118 +++++
 MAINTAINERS                                   |   8 +
 drivers/iio/adc/Kconfig                       |  22 +
 drivers/iio/adc/Makefile                      |   2 +
 drivers/iio/adc/ltc2378-offload-buffer.c      | 296 ++++++++++++
 drivers/iio/adc/ltc2378.c                     | 454 ++++++++++++++++++
 drivers/iio/adc/ltc2378.h                     | 113 +++++
 7 files changed, 1013 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ltc2378.yaml
 create mode 100644 drivers/iio/adc/ltc2378-offload-buffer.c
 create mode 100644 drivers/iio/adc/ltc2378.c
 create mode 100644 drivers/iio/adc/ltc2378.h


base-commit: 6f15decff24dac42895c0f01f0c2143f9b8961a6
-- 
2.53.0
Re: [PATCH v2 0/4] iio: adc: Add support for LTC2378 and similar ADCs
Posted by Andy Shevchenko 5 days, 5 hours ago
On Thu, May 28, 2026 at 12:02:53PM -0300, Marcelo Schmitt wrote:
> 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 initial support patch enables single-shot sample read with a GPIO connected
> to the CNV pin.
> 
> The second support 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.
> 
> 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.

No datasheet link, no explanation why the brand new driver is needed.
No need to resend, just answer the above questions.

> Link to v1: https://lore.kernel.org/linux-iio/cover.1779117444.git.marcelo.schmitt1@gmail.com/

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v2 0/4] iio: adc: Add support for LTC2378 and similar ADCs
Posted by Marcelo Schmitt 4 days, 23 hours ago
On 06/03, Andy Shevchenko wrote:
> On Thu, May 28, 2026 at 12:02:53PM -0300, Marcelo Schmitt wrote:
> > 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 initial support patch enables single-shot sample read with a GPIO connected
> > to the CNV pin.
> > 
> > The second support 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.
> > 
> > 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.
> 
> No datasheet link, no explanation why the brand new driver is needed.
> No need to resend, just answer the above questions.

Hello Andy, thank you for having a look at this set.

In short, this new driver is needed for supporting LTC2378-20 and similar ADCs.
Even though these parts are somewhat similar to AD4000, the available HDL for
high speed sample rate mode is different and the wiring configuration is also
different. Because of that, I think cramming LTC2378 support into AD4000 driver
might not be a good idea. I'll add a note about that in v3 together with
datasheet links.

There are some good points that Jonathan and sashiko raised in v2 and I'm still
working out a solution for some of them. Will share a v3 after tackling out the
remaining issues.

Thanks,
Marcelo

> 
> > Link to v1: https://lore.kernel.org/linux-iio/cover.1779117444.git.marcelo.schmitt1@gmail.com/
> 
> -- 
> With Best Regards,
> Andy Shevchenko