summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2019-03-19 13:37:55 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-31 06:46:24 -0700
commitd7c773412f4bc05e2a68cbf7b93447dd0e9b1453 (patch)
tree09128300ad95405c8fc1b63b663c92c463c2cfcc /include/linux
parentce59174d4e69b3a8d788e7c7875d1e492bccbb84 (diff)
downloadlinux-stable-d7c773412f4bc05e2a68cbf7b93447dd0e9b1453.tar.gz
linux-stable-d7c773412f4bc05e2a68cbf7b93447dd0e9b1453.tar.bz2
linux-stable-d7c773412f4bc05e2a68cbf7b93447dd0e9b1453.zip
iio: ad_sigma_delta: Properly handle SPI bus locking vs CS assertion
[ Upstream commit df1d80aee963480c5c2938c64ec0ac3e4a0df2e0 ] For devices from the SigmaDelta family we need to keep CS low when doing a conversion, since the device will use the MISO line as a interrupt to indicate that the conversion is complete. This is why the driver locks the SPI bus and when the SPI bus is locked keeps as long as a conversion is going on. The current implementation gets one small detail wrong though. CS is only de-asserted after the SPI bus is unlocked. This means it is possible for a different SPI device on the same bus to send a message which would be wrongfully be addressed to the SigmaDelta device as well. Make sure that the last SPI transfer that is done while holding the SPI bus lock de-asserts the CS signal. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Alexandru Ardelean <Alexandru.Ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/iio/adc/ad_sigma_delta.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h
index 730ead1a46df..57c122ae5452 100644
--- a/include/linux/iio/adc/ad_sigma_delta.h
+++ b/include/linux/iio/adc/ad_sigma_delta.h
@@ -66,6 +66,7 @@ struct ad_sigma_delta {
bool irq_dis;
bool bus_locked;
+ bool keep_cs_asserted;
uint8_t comm;