From 05eda67d2c31f3e8d815c3fc14f4dbb612363eab Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 27 Jun 2012 10:58:27 +0200 Subject: [PATCH] staging:iio:ad7793: Fix scan index for the "shorted" channel 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 Signed-off-by: Jonathan Cameron --- 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 b36556fa2957..92d8c255d470 100644 --- a/drivers/staging/iio/adc/ad7793.c +++ b/drivers/staging/iio/adc/ad7793.c @@ -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] = { @@ -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] = { -- 2.39.2