linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: ad_sigma_delta: select channel when reading register
@ 2019-03-19 10:47 Alexandru Ardelean
  2019-03-24 17:51 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandru Ardelean @ 2019-03-19 10:47 UTC (permalink / raw)
  To: linux-iio; +Cc: Dragos Bogdan, Alexandru Ardelean

From: Dragos Bogdan <dragos.bogdan@analog.com>

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>
---
 drivers/iio/adc/ad_sigma_delta.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
index ff5f2da2e1b1..54d9978b2740 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);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: ad_sigma_delta: select channel when reading register
  2019-03-19 10:47 [PATCH] iio: ad_sigma_delta: select channel when reading register Alexandru Ardelean
@ 2019-03-24 17:51 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2019-03-24 17:51 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, Dragos Bogdan

On Tue, 19 Mar 2019 12:47:00 +0200
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> From: Dragos Bogdan <dragos.bogdan@analog.com>
> 
> 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>
Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ad_sigma_delta.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
> index ff5f2da2e1b1..54d9978b2740 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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-24 17:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19 10:47 [PATCH] iio: ad_sigma_delta: select channel when reading register Alexandru Ardelean
2019-03-24 17:51 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).