android_kernel_oneplus_msm8998/drivers/iio
Eugen Hristev cc8e1ff726 iio: adc: at91: fix wrong channel number in triggered buffer mode
commit aea835f2dc8a682942b859179c49ad1841a6c8b9 upstream.

When channels are registered, the hardware channel number is not the
actual iio channel number.
This is because the driver is probed with a certain number of accessible
channels. Some pins are routed and some not, depending on the description of
the board in the DT.
Because of that, channels 0,1,2,3 can correspond to hardware channels
2,3,4,5 for example.
In the buffered triggered case, we need to do the translation accordingly.
Fixed the channel number to stop reading the wrong channel.

Fixes: 0e589d5fb ("ARM: AT91: IIO: Add AT91 ADC driver.")
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-21 09:27:35 +01:00
..
accel iio: st_pressure: st_accel: pass correct platform data to init 2018-03-28 18:40:12 +02:00
adc iio: adc: at91: fix wrong channel number in triggered buffer mode 2018-11-21 09:27:35 +01:00
amplifiers
buffer iio:buffer: make length types match kfifo types 2018-07-03 11:21:30 +02:00
chemical
common iio: hid-sensor-trigger: Fix the race with user space powering up sensors 2017-08-30 10:19:27 +02:00
dac
frequency iio: ad9523: Fix return value for ad952x_store() 2018-09-09 20:04:33 +02:00
gyro
humidity
imu iio: adis_lib: Initialize trigger before requesting interrupt 2018-02-28 10:17:22 +01:00
light iio: light: fix improper return value 2017-11-30 08:37:27 +00:00
magnetometer iio: magnetometer: st_magn_spi: fix spi_device_id table 2018-04-13 19:50:21 +02:00
orientation
potentiometer
pressure iio: st_pressure: st_accel: pass correct platform data to init 2018-03-28 18:40:12 +02:00
proximity iio: proximity: as3935: recalibrate RCO after resume 2017-06-26 07:13:09 +02:00
temperature
trigger iio: trigger: free trigger resource correctly 2017-11-15 17:13:10 +01:00
iio_core.h
iio_core_trigger.h
industrialio-buffer.c iio: buffer: check if a buffer has been set up when poll is called 2018-02-28 10:17:22 +01:00
industrialio-core.c iio: core: Return error for failed read_reg 2017-10-12 11:27:34 +02:00
industrialio-event.c
industrialio-trigger.c
industrialio-triggered-event.c
inkern.c
Kconfig
Makefile