[PATCH 0/5] iio: adc: ad_sigma_delta: Add sequencer support

From: alexandru.tachici
Date: Wed Nov 10 2021 - 06:07:34 EST


From: Alexandru Tachici <alexandru.tachici@xxxxxxxxxx>

Some sigma-delta chips support sampling of multiple
channels in continuous mode.

When the operating with more than one channel enabled,
the channel sequencer cycles through the enabled channels
in sequential order, from first channel to the last one.
If a channel is disabled, it is skipped by the sequencer.

If more than one channel is used in continuous mode,
instruct the device to append the status to the SPI transfer
(1 extra byte) every time we receive a sample.
All sigma-delta chips possessing a sampling sequencer have
this ability. Inside the status register there will be
the number of the converted channel. In this way, even
if the CPU won't keep up with the sampling rate, it won't
send to userspace wrong channel samples.

1. Fix bug in AD7124 where channels stayed enabled
even when they are not supposed to, in continuous mode.

2. Fix bug in AD7192 where channels stayed enabled
even when they are not supposed to, in continuous mode.

3. Add sequencer support for sigma_delta library.

4. Add sigma_delta_info values and callbacks for sequencer
support in AD7124.

5. Add sigma_delta_info values and callbacks for sequencer
support in AD7192.

Alexandru Tachici (5):
iio: adc: ad7124: Add update_scan_mode
iio: adc: ad7192: Add update_scan_mode
iio: adc: ad_sigma_delta: Add sequencer support
iio: adc: ad7124: add sequencer support
iio: adc: ad7192: add sequencer support

drivers/iio/adc/ad7124.c | 38 ++++++++-
drivers/iio/adc/ad7192.c | 32 +++++++-
drivers/iio/adc/ad_sigma_delta.c | 106 ++++++++++++++++++++-----
include/linux/iio/adc/ad_sigma_delta.h | 22 +++++
4 files changed, 178 insertions(+), 20 deletions(-)

--
2.25.1