* [PATCH] staging:iio:ad7793: Fix scan index for the "shorted" channel
@ 2012-06-27 8:58 Lars-Peter Clausen
2012-06-30 12:39 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2012-06-27 8:58 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio, Lars-Peter Clausen
The code expects the scan index to match the offset of the channel into the
channel array. For the "shorted" the offset is 3, but the scan index is set to
2. Also the scan index 2 is already taken by the previous channel. As a result
the "shorted" channel will appear to be selected if the previous channel is
selected and vice versa and it is not possible to sample the "shorted" channel
in buffered mode.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/staging/iio/adc/ad7793.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/iio/adc/ad7793.c b/drivers/staging/iio/adc/ad7793.c
index 89873f4..76fdd71 100644
--- a/drivers/staging/iio/adc/ad7793.c
+++ b/drivers/staging/iio/adc/ad7793.c
@@ -758,7 +758,7 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.address = AD7793_CH_AIN1M_AIN1M,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
- .scan_index = 2,
+ .scan_index = 3,
.scan_type = IIO_ST('s', 24, 32, 0)
},
.channel[4] = {
@@ -831,7 +831,7 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.address = AD7793_CH_AIN1M_AIN1M,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
- .scan_index = 2,
+ .scan_index = 3,
.scan_type = IIO_ST('s', 16, 32, 0)
},
.channel[4] = {
--
1.7.10
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] staging:iio:ad7793: Fix scan index for the "shorted" channel
2012-06-27 8:58 [PATCH] staging:iio:ad7793: Fix scan index for the "shorted" channel Lars-Peter Clausen
@ 2012-06-30 12:39 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2012-06-30 12:39 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Jonathan Cameron, linux-iio
On 06/27/2012 09:58 AM, Lars-Peter Clausen wrote:
> The code expects the scan index to match the offset of the channel into the
> channel array. For the "shorted" the offset is 3, but the scan index is set to
> 2. Also the scan index 2 is already taken by the previous channel. As a result
> the "shorted" channel will appear to be selected if the previous channel is
> selected and vice versa and it is not possible to sample the "shorted" channel
> in buffered mode.
>
merged. Thanks
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
> drivers/staging/iio/adc/ad7793.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/ad7793.c b/drivers/staging/iio/adc/ad7793.c
> index 89873f4..76fdd71 100644
> --- a/drivers/staging/iio/adc/ad7793.c
> +++ b/drivers/staging/iio/adc/ad7793.c
> @@ -758,7 +758,7 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
> .address = AD7793_CH_AIN1M_AIN1M,
> .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
> IIO_CHAN_INFO_SCALE_SHARED_BIT,
> - .scan_index = 2,
> + .scan_index = 3,
> .scan_type = IIO_ST('s', 24, 32, 0)
> },
> .channel[4] = {
> @@ -831,7 +831,7 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
> .address = AD7793_CH_AIN1M_AIN1M,
> .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
> IIO_CHAN_INFO_SCALE_SHARED_BIT,
> - .scan_index = 2,
> + .scan_index = 3,
> .scan_type = IIO_ST('s', 16, 32, 0)
> },
> .channel[4] = {
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-30 12:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-27 8:58 [PATCH] staging:iio:ad7793: Fix scan index for the "shorted" channel Lars-Peter Clausen
2012-06-30 12:39 ` 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).