]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: ad7124: reduce the number of SPI transfers
authorDumitru Ceclan <mitrutzceclan@gmail.com>
Wed, 31 Jul 2024 12:37:24 +0000 (15:37 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 3 Aug 2024 15:05:15 +0000 (16:05 +0100)
commitb7eef979b7ac267187218a515ce4afb502fe18c7
tree3a94d5d81c908299d68fd0680ae762948e1845bf
parent13fad2607dad14afd0633d9c869499f6e7c998bd
iio: adc: ad7124: reduce the number of SPI transfers

The ad7124_init_config_vref() function writes the AD7124_ADC_CONTROL
register for each channel that is configured to use the internal
reference.

The ad7124_write_config()function performs 7 SPI transfers for
configuring 2 registers: config_x and filter_x.

Reduce the number of SPI transfers:
-during the probe by only setting the st->adc_control value in
 ad7124_init_config_vref() and writing to the device only at the end of
 ad7124_setup().
-in ad7124_write_config() by grouping writes to the same register.

Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240731-ad7124-fix-v1-3-46a76aa4b9be@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7124.c