]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: ad4695: add offload-based oversampling support
authorTrevor Gamblin <tgamblin@baylibre.com>
Thu, 9 Jan 2025 18:47:23 +0000 (13:47 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 11 Feb 2025 19:32:31 +0000 (19:32 +0000)
commit67d63185db79fa5c17ddb948599b7e2f0e031003
treed8dd80c4b112741470f2f41a0f80bab651c9a6cd
parent192b669b930c16f493dde1b2a3e9b25e466fd624
iio: adc: ad4695: add offload-based oversampling support

Add support for the ad4695's oversampling feature when SPI offload is
available. This allows the ad4695 to set oversampling ratios on a
per-channel basis, raising the effective-number-of-bits from 16
(OSR == 1) to 17 (4), 18 (16), or 19 (64) for a given sample (i.e. one
full cycle through the auto-sequencer). The logic for reading and
writing sampling frequency for a given channel is also adjusted based on
the current oversampling ratio.

The non-offload case isn't supported as there isn't a good way to
trigger the CNV pin in this mode. Support could be added in the future
if a use-case arises.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Tested-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250109-ad4695-oversampling-v2-1-a46ac487082c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad4695.c