]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: ad7380: use spi_optimize_message()
authorDavid Lechner <dlechner@baylibre.com>
Thu, 30 May 2024 15:14:11 +0000 (10:14 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 4 Jun 2024 18:53:08 +0000 (19:53 +0100)
commit99d46eecf98fe9af4573363fcb5c8d8d36ce875e
treee3dd717476fd26b16f21dbf0428e21db10a4df84
parentd8f2bb50845f2797f594ffe3cac9417abff4d7b0
iio: adc: ad7380: use spi_optimize_message()

This changes the AD7380 to use spi_optimize_message() to optimize
buffered reads.

This changes both direct reads and buffered reads to use the same
spi_message. This has some (welcome) side effects. The first is that
in buffered reads, the timestamp will now correspond to the same sample
rather than the previous sample. The second is that direct reads now
use the same SPI bus speed as buffered reads.

This reduces CPU usage of the IRQ thread from around 25% to around 20%
when sampling at 10 kHz on a ZedBoard.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240530-iio-add-support-for-multiple-scan-types-v3-4-cbc4acea2cfa@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7380.c