mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/5] iio: adc: ad7625: add LTC2387 and ADAQ2387x support
@ 2026-11-04 13:21 Nicolae-Daniel Deaconescu
  2026-11-04 13:21 ` [PATCH v2 1/5] pwm: core: add pwm_get_waveform_step_might_sleep() Nicolae-Daniel Deaconescu
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Nicolae-Daniel Deaconescu @ 2026-11-04 13:21 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Uwe Kleine-König, Conor Dooley, Krzysztof Kozlowski,
	Rob Herring, David Lechner, Nuno Sá,
	Andy Shevchenko, Michael Hennerich, Trevor Gamblin,
	Joshua Crofts, Sergiu Cuciurean, linux-iio, devicetree,
	linux-pwm, linux-doc, linux-kernel, Nicolae-Daniel Deaconescu

Hi all,

This adds the LTC2387-16, LTC2387-18, ADAQ23875, ADAQ23876 and ADAQ23878
to the ad7625 driver and binding. v1 added them as a separate ltc2387
driver. After receiving feedback, this version refactors the driver
into the existing ad7625 and modifies the pwm backend for clear
layering.

The parts are single channel differential 16 and 18 bit SAR ADCs, up to
15 MSPS. Like the AD762x and AD796x they are read with two PWMs (CNV and
CLK) and an IIO backend that captures the LVDS data. The differences are
handled as chip data and a few quirks:

- Output is double data rate on one or two lanes (TWOLANES pin), so the
  CLK burst is resolution / 4 or resolution / 2 pulses long.
- The burst has to start at least t_FIRSTCLK after CNV and end at most
  t_LASTCLK after the next CNV, so at high rates it runs into the next
  conversion period. The sampling period is raised until it fits. With two
  lanes 15 MSPS is reachable, with one lane the limit is about 10.9 MSPS
  (16 bit) and 10 MSPS (18 bit) at a 120 MHz PWM clock.
- No EN pins. The second PWM is named "clk" for these parts, as Conor
  asked, and keeps the name "clk_gate" for the existing parts, as renaming
  it would change their binding.
- The ADAQ modules have a fully differential amplifier in front of the
  ADC, so the scale is divided by its gain. The gain is fixed on the
  ADAQ23875 and pin strapped on the ADAQ23876 and ADAQ23878, so it is
  given in the devicetree (adi,gain-milli).

Patches 1 and 2 add what the driver needs from the PWM. The timing of the
burst has to be placed in whole steps of the PWM, and a rounding function
that rounds down can't tell the consumer how big a step is. Conor pointed
out that reading the rate from a clock breaks if the PWM provider has
a mandatory divider. So the provider now reports the clock rate and the
number of clock cycles per step.

Changes since v1 (separate ltc2387 driver):
- Joined to ad7625 (binding, driver, Kconfig and documentation).
- Dropped the clocks property of the ADC, added the PWM waveform step API.
- Compatibles use the adi, prefix and the datasheet part numbers.
- Dropped the x4 parts.
- Fixed The missing return of dev_err_probe() for the initial sampling
 frequency.
- Added the maintainers of the new parts to the AD7625 entry.

AI disclosure: parts of the commit text and the code were checked with an
AI coding assistant (Claude): the first version of the merge into ad7625,
the PWM step API, the timing arithmetic and the test scripts. I reviewed
every change, built it and ran tests on the ADAQ23875 + ZedBoard.

Link to v1: https://lore.kernel.org/all/20261027134409.76824-1-Nicolae-daniel.Deaconescu@analog.com/

Nicolae-Daniel Deaconescu (3):
  pwm: core: add pwm_get_waveform_step_might_sleep()
  pwm: axi-pwmgen: report the waveform step
  iio: adc: ad7625: fix sampling frequency handling

Sergiu Cuciurean (2):
  dt-bindings: iio: adc: adi,ad7625: add LTC2387 and ADAQ2387x
  iio: adc: ad7625: add LTC2387 and ADAQ2387x support

 .../bindings/iio/adc/adi,ad7625.yaml          | 193 ++++++++-
 Documentation/iio/ad7625.rst                  |  34 +-
 MAINTAINERS                                   |   2 +
 drivers/iio/adc/Kconfig                       |   7 +-
 drivers/iio/adc/ad7625.c                      | 402 ++++++++++++++++--
 drivers/pwm/core.c                            |  63 +++
 drivers/pwm/pwm-axi-pwmgen.c                  |  13 +
 include/linux/pwm.h                           |  32 ++
 8 files changed, 703 insertions(+), 43 deletions(-)


base-commit: 43ffda3c7f8456bbe641ae8249a077a361b97880
-- 
2.34.1


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

end of thread, other threads:[~2026-11-05  0:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 13:21 [PATCH v2 0/5] iio: adc: ad7625: add LTC2387 and ADAQ2387x support Nicolae-Daniel Deaconescu
2026-11-04 13:21 ` [PATCH v2 1/5] pwm: core: add pwm_get_waveform_step_might_sleep() Nicolae-Daniel Deaconescu
2026-11-04 19:51   ` Andy Shevchenko
2026-11-04 13:21 ` [PATCH v2 2/5] pwm: axi-pwmgen: report the waveform step Nicolae-Daniel Deaconescu
2026-11-04 13:21 ` [PATCH v2 3/5] iio: adc: ad7625: fix sampling frequency handling Nicolae-Daniel Deaconescu
2026-11-04 13:21 ` [PATCH v2 4/5] dt-bindings: iio: adc: adi,ad7625: add LTC2387 and ADAQ2387x Nicolae-Daniel Deaconescu
2026-11-05  0:23   ` Conor Dooley
2026-11-04 13:21 ` [PATCH v2 5/5] iio: adc: ad7625: add LTC2387 and ADAQ2387x support Nicolae-Daniel Deaconescu
2026-11-04 20:22   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®