summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDragos Bogdan <dragos.bogdan@analog.com>2019-03-19 12:47:00 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-27 09:30:30 +0200
commit9d4f298b95e4a5fd550fc258834b846af64815c1 (patch)
tree0d75a3c168a7a66914dbfb5b6339817f44bacf2d
parent55b4957dcc74722ebea24a12a33e5c5c03b8495f (diff)
downloadlinux-stable-9d4f298b95e4a5fd550fc258834b846af64815c1.tar.gz
linux-stable-9d4f298b95e4a5fd550fc258834b846af64815c1.tar.bz2
linux-stable-9d4f298b95e4a5fd550fc258834b846af64815c1.zip
iio: ad_sigma_delta: select channel when reading register
commit fccfb9ce70ed4ea7a145f77b86de62e38178517f upstream. The desired channel has to be selected in order to correctly fill the buffer with the corresponding data. The `ad_sd_write_reg()` already does this, but for the `ad_sd_read_reg_raw()` this was omitted. Fixes: af3008485ea03 ("iio:adc: Add common code for ADI Sigma Delta devices") Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/iio/adc/ad_sigma_delta.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
index 22c4c17cd996..a1d072ecb717 100644
--- a/drivers/iio/adc/ad_sigma_delta.c
+++ b/drivers/iio/adc/ad_sigma_delta.c
@@ -121,6 +121,7 @@ static int ad_sd_read_reg_raw(struct ad_sigma_delta *sigma_delta,
if (sigma_delta->info->has_registers) {
data[0] = reg << sigma_delta->info->addr_shift;
data[0] |= sigma_delta->info->read_mask;
+ data[0] |= sigma_delta->comm;
spi_message_add_tail(&t[0], &m);
}
spi_message_add_tail(&t[1], &m);