Skip to content

Commit

Permalink
staging:iio:ad7793: Fix scan index for the "shorted" channel
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Jun 30, 2012
1 parent ce7b04c commit 05eda67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/iio/adc/ad7793.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,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] = {
Expand Down Expand Up @@ -859,7 +859,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] = {
Expand Down

0 comments on commit 05eda67

Please sign in to comment.