]> www.infradead.org Git - users/hch/misc.git/commit
iio: adc: ad_sigma_delta: use spi_optimize_message()
authorDavid Lechner <dlechner@baylibre.com>
Tue, 1 Jul 2025 21:37:56 +0000 (16:37 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 13 Jul 2025 14:36:25 +0000 (15:36 +0100)
commitdb63e45a7da0678652c69f7cbed2cbf2a9922b39
treeaf82f0ed9b190f069b61ed56e910467dd69836d7
parent1519bedf884c0a7c316906459d8c7da12113a8a9
iio: adc: ad_sigma_delta: use spi_optimize_message()

Use spi_optimize_message() to improve the performance of buffered reads.

By setting up the SPI message and pre-optimizing it in the buffer
postenable callback, we can reduce overhead during each sample read.

A rough estimate shows that this reduced the CPU usage of the interrupt
handler thread from 22% to 16% using an EVAL-AD4112ARDZ board on a
DE10-Nano (measuring a single channel at the default 6.2 kHz sample
rate).

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250701-iio-adc-ad7173-add-spi-offload-support-v3-8-42abb83e3dac@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad_sigma_delta.c
include/linux/iio/adc/ad_sigma_delta.h