Devicetree
 help / color / mirror / Atom feed
* [PATCH v4 00/10] iio: adc: Add TI ADS126X ADC family support
@ 2026-08-28  6:38 Kurt Borja
  2026-08-28  6:38 ` [PATCH v4 01/10] dt-bindings: adc: add excitation-current-chopping property Kurt Borja
                   ` (9 more replies)
  0 siblings, 10 replies; 21+ messages in thread
From: Kurt Borja @ 2026-08-28  6:38 UTC (permalink / raw)
  To: Kurt Borja, Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, David Lechner
  Cc: Nuno Sá, Andy Shevchenko, linux-iio, devicetree,
	linux-kernel

Hi all,

This series introduces support for TI ADS1262 and ADS1263 ADCs [1].
These devices are very similar (if not the same), except ADS1263
includes a secondary auxiliary ADC.

I plan to add these features to the main driver soon:

  - Filters
  - Calibration (manual and automatic)
  - GPIO controller capabilities
  - Channel hot-reloading in buffer mode
  - SPI offload support (38400 SPS turns out to be too high for some
    systems)
  - Conversion delay support
  - The ti-ads1263-adc2 driver for ADC2

The auxiliary ADC operates almost completely independent of the main
ADC. The only consideration that has to be taken for interoperability is
when reading conversion data in direct mode (Datasheet 9.4.7.1), which
happens only in buffer mode, when multiple channels are enabled.

When reading data in direct mode, all SPI activity is forbidden between
the data-ready signal and the data retrieval. To achieve this a second
mutex called xfer_lock was introduced to block SPI activity on the
device.

This is one of the biggest drivers I've developed, so I hope the code
and the comments are self-explanatory. If not, please let me know so I
can clarify them.

As always, thanks for your reviews and help. Submitting upstream is
always a great learning experience :)

[1] https://www.ti.com/lit/ds/symlink/ads1263.pdf

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
v4:
  dt-bindings
  -----------

  - Added excitation-current-chopping property to adc.yaml. I decided to
    go for *current* instead of *channel* because the current source is
    what's actually being swapped in-between conversions. IMO this is
    more accurate and also matches the terminology used in ad4170-4's
    datasheet.

  - Remove monitor channels from devicetree as their configuration is
    usually fixed

  - Allow ADS1263 parts to also specify #io-channel-cells = 1 and be
    fully compatible with ADS1262. (Sashiko)

  - In interrupt-names description, explain 'drdy' and 'doutdrdy' are
    two independent physical interrupts which output the same DRDY
    signal. (Sashiko)

  - Clarify the ground assumption on refp and refn regulators

  - In the example, describe vbias as an empty object instead of adding
    a redundant regulator-name.

  ti-ads1262
  ----------

  - Multi-channel buffered sampling is now done in PULSE mode to avoid
    missing interrupts due to latency

  - Monitor channels are defined statically, as opossed to parsing them
    from devicetree

  - Stop using devicetree 'reg' as the channel's scan_index because
    there might be "disabled" channels.

  - Setup power supplies before enabling the clock

  - Get the RESET GPIOD locally in ads1262_dev_reset() to avoid having
    to store the pointer to it

  - Only register regulators if the "regulator" node is present in
    firmware

  - Add .is_enabled() callback to refout (Sashiko)

  - Removed include <linux/mod_devicetable.h>

  - Restrict the available sample rates to those compatible with the FIR
    filter until other filters are supported

  - There's a few conditions that require the voltage magnitude of the
    power supplies. Instead of keeping track of each individually, get a
    handle to the regulator and get the voltage on demand.

  - Add fwnode_xlate callback to prepare for future ADC2 support

  - Added validate_scan_mask callback because the DRDY trigger is not
    supported when multiple channels are enabled (although it would not
    be the end of the world, the buffer would just fail to fill)

  Misc:
    - Renamed ads1262_dev_cmd() to ads1262_dev_send_cmd()
    - Removed __aligned(IIO_DMA_MIN_ALIGN) from rx[] buffer
    - Add ADS1262_SPI_XFER_SZ macro and a couple of static_assert()
    - Removed sign_extend32() because a simple cast is enough
    - Replaced regmap_read_bypassed() with plain regmap_read() in
      debugfs callback
    - Use -ENODEV instead of -ENXIO in some error paths
    - Added macro for internal/nominal clock rate
    - Reword dt-bindings patch for more clarity
    - Reword main driver patch for more clarity and some development
      details
    - Move register field values to macros instead of enums
    - Refactor ads1262_find_two()
    - Use regmap_test_bits() in regulator callbacks
    - Improve style of reg defaults table
    - Regulators are now registered only if there is a "regulators" node
      on the device

v3: https://patch.msgid.link/20260807-ads126x-v3-0-f89925d72792@gmail.com
v2: https://patch.msgid.link/20260628-ads126x-v2-0-4b1b231325ba@gmail.com
v1: https://patch.msgid.link/20260612-ads126x-v1-0-894c788d03ed@gmail.com

---
Kurt Borja (10):
      dt-bindings: adc: add excitation-current-chopping property
      dt-bindings: iio: adc: support the TI ADS126x ADC family
      iio: adc: add the ti-ads1262 driver
      iio: adc: ti-ads1262: support per-channel sampling frequency
      iio: adc: ti-ads1262: support per-channel reference and gain
      iio: adc: ti-ads1262: support input chopping
      iio: adc: ti-ads1262: support excitation currents
      iio: adc: ti-ads1262: support triggered buffer sampling
      iio: adc: ti-ads1262: support REFOUT and VBIAS regulators
      iio: adc: ti-ads1262: support common mode supplies

 Documentation/devicetree/bindings/iio/adc/adc.yaml |    8 +
 .../devicetree/bindings/iio/adc/ti,ads1262.yaml    |  376 ++++
 MAINTAINERS                                        |    7 +
 drivers/iio/adc/Kconfig                            |   14 +
 drivers/iio/adc/Makefile                           |    1 +
 drivers/iio/adc/ti-ads1262.c                       | 2163 ++++++++++++++++++++
 6 files changed, 2569 insertions(+)
---
base-commit: 22359083a9e74d538ce383d5c0ee30cc20182187
change-id: 20251129-ads126x-fb6107505cae

-- 
Thanks, 
 ~ Kurt


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

end of thread, other threads:[~2026-08-28 16:40 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28  6:38 [PATCH v4 00/10] iio: adc: Add TI ADS126X ADC family support Kurt Borja
2026-08-28  6:38 ` [PATCH v4 01/10] dt-bindings: adc: add excitation-current-chopping property Kurt Borja
2026-08-28 16:33   ` Conor Dooley
2026-08-28  6:38 ` [PATCH v4 02/10] dt-bindings: iio: adc: support the TI ADS126x ADC family Kurt Borja
2026-08-28  6:45   ` sashiko-bot
2026-08-28 16:39   ` Conor Dooley
2026-08-28  6:38 ` [PATCH v4 03/10] iio: adc: add the ti-ads1262 driver Kurt Borja
2026-08-28  6:52   ` sashiko-bot
2026-08-28  8:09   ` Andy Shevchenko
2026-08-28  6:38 ` [PATCH v4 04/10] iio: adc: ti-ads1262: support per-channel sampling frequency Kurt Borja
2026-08-28  7:03   ` sashiko-bot
2026-08-28  6:38 ` [PATCH v4 05/10] iio: adc: ti-ads1262: support per-channel reference and gain Kurt Borja
2026-08-28  6:38 ` [PATCH v4 06/10] iio: adc: ti-ads1262: support input chopping Kurt Borja
2026-08-28  6:38 ` [PATCH v4 07/10] iio: adc: ti-ads1262: support excitation currents Kurt Borja
2026-08-28  6:57   ` sashiko-bot
2026-08-28  6:38 ` [PATCH v4 08/10] iio: adc: ti-ads1262: support triggered buffer sampling Kurt Borja
2026-08-28  6:57   ` sashiko-bot
2026-08-28  6:38 ` [PATCH v4 09/10] iio: adc: ti-ads1262: support REFOUT and VBIAS regulators Kurt Borja
2026-08-28  6:53   ` sashiko-bot
2026-08-28  6:38 ` [PATCH v4 10/10] iio: adc: ti-ads1262: support common mode supplies Kurt Borja
2026-08-28  7:03   ` sashiko-bot

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