]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: mxs-lradc: fix iio channel map regression
authorStefan Wahren <stefan.wahren@i2se.com>
Sat, 3 Jan 2015 20:34:12 +0000 (20:34 +0000)
committerLuis Henriques <luis.henriques@canonical.com>
Wed, 18 Mar 2015 14:41:45 +0000 (14:41 +0000)
commit 03305e535cd5cdc1079b32909bf4b2dd67d46f7f upstream.

Since commit c8231a9af8147f8a ("iio: mxs-lradc: compute temperature
from channel 8 and 9") with the removal of adc channel 9 there is
no 1-1 mapping in the channel spec.

All hwmon channel values above 9 are accessible via there index minus
one. So add a hidden iio channel 9 to fix this issue.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/staging/iio/adc/mxs-lradc.c

index 4907efaf5e3d19c5858860b886263602343b311f..37a1192f1637a688af78fe72d9f36e33a4cd8982 100644 (file)
@@ -1402,6 +1402,13 @@ static const struct iio_chan_spec mxs_lradc_chan_spec[] = {
                .channel = 8,
                .scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,},
        },
+       /* Hidden channel to keep indexes */
+       {
+               .type = IIO_TEMP,
+               .indexed = 1,
+               .scan_index = -1,
+               .channel = 9,
+       },
        MXS_ADC_CHAN(10, IIO_VOLTAGE),  /* VDDIO */
        MXS_ADC_CHAN(11, IIO_VOLTAGE),  /* VTH */
        MXS_ADC_CHAN(12, IIO_VOLTAGE),  /* VDDA */