Skip to content

Commit 03305e5

Browse files
Stefan Wahrenjic23
authored andcommitted
iio: mxs-lradc: fix iio channel map regression
Since commit c8231a9 ("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> Cc: Stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent 19e353f commit 03305e5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎drivers/staging/iio/adc/mxs-lradc.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,13 @@ static const struct iio_chan_spec mxs_lradc_chan_spec[] = {
13971397
.channel = 8,
13981398
.scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,},
13991399
},
1400+
/* Hidden channel to keep indexes */
1401+
{
1402+
.type = IIO_TEMP,
1403+
.indexed = 1,
1404+
.scan_index = -1,
1405+
.channel = 9,
1406+
},
14001407
MXS_ADC_CHAN(10, IIO_VOLTAGE), /* VDDIO */
14011408
MXS_ADC_CHAN(11, IIO_VOLTAGE), /* VTH */
14021409
MXS_ADC_CHAN(12, IIO_VOLTAGE), /* VDDA */

0 commit comments

Comments
 (0)