]> git.ipfire.org Git - thirdparty/linux.git/commit
iio: adc: ad7124: Micro-optimize channel disabling
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Mon, 20 Jan 2025 14:07:09 +0000 (15:07 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 8 Feb 2025 15:10:15 +0000 (15:10 +0000)
commitcf67879bd4280f6243103e281595f9b523c61481
tree44b52aa69e669aba4bb2904a44326314d091f092
parent3ea0944dca9b855da474fbe08401fb82b2d9af99
iio: adc: ad7124: Micro-optimize channel disabling

The key objective in ad7124_disable_one() is clearing the
AD7124_CHANNEL_EN_MSK bit in the channel register. However there is no
advantage to keep the other bits in that register because when the
channel is used next time, all fields are rewritten anyhow. So instead
of using ad7124_spi_write_mask() (which is a register read plus a
register write) use a simple register write clearing the complete
register.

Also do the same in the .disable_all() callback by using the
.disable_one() callback there.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250120140708.1093655-2-u.kleine-koenig@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7124.c