Skip to content

iio: adc: add TI ADS1299

Stephan Costa Barros linux-devicetree linux-iio lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2dt-bindings: iio: adc: add TI ADS1299Documentation/devicetree/bindings/iio/adc/ti,ads1299.yaml MAINTAINERS+227 -01 reply
2/2iio: adc: ti-ads1299: add driver for TI ADS1299MAINTAINERS drivers/iio/adc/Kconfig drivers/iio/adc/Makefile +1 more+913 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] iio: adc: add TI ADS1299

This series adds a driver for the TI ADS1299 family (ADS1299, ADS1299-6 and ADS1299-4): 24-bit, simultaneous-sampling biopotential front-ends for EEG, on SPI.

This first version keeps to the generic IIO ABI: raw reads, the gain of each channel's PGA through its scale, the sampling frequency, and a kfifo buffer fed from the DRDY interrupt with a software timestamp.

The part has more, which I would like to add in follow-up series, each with its own ABI discussion: SRB1 and SRB2 reference routing, the bias drive amplifier, lead-off detection (through IIO_EV_TYPE_FAULT and IIO_EV_DIR_FAULT_OPENWIRE), the internal test signal, the temperature sensor and supply monitors, GPIO1 to GPIO4 as a gpiochip, the CLK pin as a clock output, and daisy chains. The binding already describes the hardware for those.

A question on structure. The driver started from ti-ads1298.c, and in this subset the two are close. What differs here is the PGA gain table (1 to 24 against 1 to 12 with 3), the data rates (no high-resolution mode), the fixed 4.5 V internal reference, the ID register layout and the 4 and 6 channel variants; above 0x14 the register maps also part (MISC1 and MISC2 here, PACE, RESP and WCT on the ADS1298). Most of what would follow, SRB1 and SRB2, the bias drive and lead-off on every channel, is specific to the ADS1299, so I kept a separate driver. If you would rather have the ADS1299 as a variant in ti-ads1298, I can rework it that way.

Tested on a Raspberry Pi 4B running 6.18.50 (Raspberry Pi OS), with one ADS1299 and DRDY on a GPIO edge interrupt, the driver built out of tree from this patch:
- every value in in_voltage_scale_available and sampling_frequency_available written and read back, and values outside the lists refused;
- the internal DC test signal, routed through debugfs register access, read at gain 24 against shorted inputs: -0.08 % to -0.41 % from VREF / 2400 across the eight channels, as with the out-of-tree driver on the same board;
- a 10 s capture at 250 SPS: 2497 samples for 2497 DRDY interrupts, no gaps in the timestamps, and buffered values matching direct reads.
So on 6.18 the driver was run and tested as above; on the IIO tree below, the same source, unchanged, was compiled but not run.

The series is based on the testing branch of Jonathan's IIO tree (git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git).

Stephan Costa Barros (2):
dt-bindings: iio: adc: add TI ADS1299
iio: adc: ti-ads1299: add driver for TI ADS1299

 .../bindings/iio/adc/ti,ads1299.yaml          | 221 +++++
 MAINTAINERS                                   |   7 +
 drivers/iio/adc/Kconfig                       |  14 +
 drivers/iio/adc/Makefile                      |   1 +
 drivers/iio/adc/ti-ads1299.c                  | 897 ++++++++++++++++++
 5 files changed, 1140 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads1299.yaml
 create mode 100644 drivers/iio/adc/ti-ads1299.c

base-commit: 19c5db3507633edc21b4172d99f573c2dfbf42b1

Signature · 1 line
2.43.0