]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
iio: adc: ti-ads7950: Ensure CS is deasserted after reading channels
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 9 Jul 2021 10:11:10 +0000 (12:11 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 24 Sep 2021 10:27:25 +0000 (12:27 +0200)
commitaf706909064e60bf07615cf81c29118045793867
treee53623c95187c60bec505ed1d6315ee53630c9ae
parentc9ed771db1ad86ea733bb1dad8a868bd3e7ac3de
iio: adc: ti-ads7950: Ensure CS is deasserted after reading channels

BugLink: https://bugs.launchpad.net/bugs/1944202
commit 9898cb24e454602beb6e17bacf9f97b26c85c955 upstream.

The ADS7950 requires that CS is deasserted after each SPI word. Before
commit e2540da86ef8 ("iio: adc: ti-ads7950: use SPI_CS_WORD to reduce
CPU usage") the driver used a message with one spi transfer per channel
where each but the last one had .cs_change set to enforce a CS toggle.
This was wrongly translated into a message with a single transfer and
.cs_change set which results in a CS toggle after each word but the
last which corrupts the first adc conversion of all readouts after the
first readout.

Fixes: e2540da86ef8 ("iio: adc: ti-ads7950: use SPI_CS_WORD to reduce CPU usage")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: David Lechner <david@lechnology.com>
Tested-by: David Lechner <david@lechnology.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210709101110.1814294-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/iio/adc/ti-ads7950.c