]> git.baikalelectronics.ru Git - kernel.git/commit
iio: adc: ad7923: fix channel readings for some variants
authorNuno Sá <nuno.sa@analog.com>
Mon, 12 Sep 2022 08:12:21 +0000 (10:12 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 21 Sep 2022 17:42:55 +0000 (18:42 +0100)
commit7df27af4124050a7a2cbd7b232336827c8f4c75b
tree17a28a3d9500bb0f16d718b765524b5d37c02778
parentd115bc4c0f04e6cbc1a03f1f633f4fcc035e4d84
iio: adc: ad7923: fix channel readings for some variants

Some of the supported devices have 4 or 2 LSB trailing bits that should
not be taken into account. Hence we need to shift these bits out which
fits perfectly on the scan type shift property. This change fixes both
raw and buffered reads.

Fixes: fa47b8eaf1b2 ("iio:adc:ad7923: Add support for the ad7904/ad7914/ad7924")
Fixes: da174d9f173e ("iio: adc: ad7923: Add support for the ad7908/ad7918/ad7928")
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220912081223.173584-2-nuno.sa@analog.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7923.c