From e70ab21849730fccacbd39c0ea76c7b80ac1e090 Mon Sep 17 00:00:00 2001 From: Michael Hennerich Date: Fri, 2 Sep 2011 17:25:36 +0100 Subject: [PATCH] staging:iio:adc:ad7291: fix channel mapping ideally in_voltageX_raw should map to AD7291 VINX. Signed-off-by: Michael Hennerich Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/adc/ad7291.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/ad7291.c b/drivers/staging/iio/adc/ad7291.c index ebb1e281e3fa..014df6248618 100644 --- a/drivers/staging/iio/adc/ad7291.c +++ b/drivers/staging/iio/adc/ad7291.c @@ -435,7 +435,7 @@ static int ad7291_read_raw(struct iio_dev *indio_dev, } /* Enable this channel alone */ regval = chip->command & (~AD7291_VOLTAGE_MASK); - regval |= 1 << (chan->channel + 8); + regval |= 1 << (15 - chan->channel); ret = ad7291_i2c_write(chip, AD7291_COMMAND, regval); if (ret < 0) { mutex_unlock(&chip->state_lock); -- 2.20.1