]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: ad7380: enable sequencer for single-ended parts
authorJulien Stephan <jstephan@baylibre.com>
Wed, 31 Jul 2024 07:05:47 +0000 (09:05 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 3 Aug 2024 10:33:35 +0000 (11:33 +0100)
commitd4c6ff182d1b7cdbe9b8149767cc834256fb688e
tree95ebd1602ce1ff0524262dd51d555ded18e5c961
parentae20f31d3d47de4f0145bd8c206f9130cf3e7544
iio: adc: ad7380: enable sequencer for single-ended parts

ad7386/7/8(-4) single-ended parts have a 2:1 mux in front of each ADC.

>From an IIO point of view, all inputs are exported, i.e ad7386/7/8
export 4 channels and ad7386-4/7-4/8-4 export 8 channels. First inputs
of muxes correspond to the first half of IIO channels (i.e 0-1 or 0-3)
and second inputs correspond to second half (i.e 2-3 or 4-7)

Currently, the driver supports only sampling first half OR second half of
the IIO channels. To enable sampling all channels simultaneously, these
parts have an internal sequencer that automatically cycles through the
mux entries.

When enabled, the maximum throughput is divided by two. Moreover, the ADCs
need additional settling time, so we add an extra CS toggle to correctly
propagate setting, and an additional spi transfer to read the second
half.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240731-ad7380-add-single-ended-chips-v2-6-cd63bf05744c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7380.c