linux/drivers/iio
Uwe Kleine-König 3e871c1d51 iio: adc: ad7124: Disable all channels at probe time
commit 4be339af33 upstream.

When during a measurement two channels are enabled, two measurements are
done that are reported sequencially in the DATA register. As the code
triggered by reading one of the sysfs properties expects that only one
channel is enabled it only reads the first data set which might or might
not belong to the intended channel.

To prevent this situation disable all channels during probe. This fixes
a problem in practise because the reset default for channel 0 is
enabled. So all measurements before the first measurement on channel 0
(which disables channel 0 at the end) might report wrong values.

Fixes: 7b8d045e49 ("iio: adc: ad7124: allow more than 8 channels")
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20241104101905.845737-2-u.kleine-koenig@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-01-17 13:34:47 +01:00
..
accel iio: accel: bma400: Fix uninitialized variable field_value in tap event handling. 2024-11-01 01:55:56 +01:00
adc iio: adc: ad7124: Disable all channels at probe time 2025-01-17 13:34:47 +01:00
addac iio: addac: Kconfig: update ad74413r selections 2023-10-19 23:08:55 +02:00
afe iio: afe: rescale: Accept only offset channels 2023-11-02 09:35:29 +01:00
amplifiers iio: amplifiers: ada4250: add missing select REGMAP_SPI in Kconfig 2024-10-22 15:56:47 +02:00
buffer iio: buffer-dmaengine: fix releasing dma channel on error 2024-09-12 11:10:26 +02:00
cdc iio: cdc: ad7746: Move driver out of staging. 2022-08-15 22:30:01 +01:00
chemical iio: chemical: bme680: Fix read/write ops to device by adding mutexes 2024-10-17 15:21:11 +02:00
common iio: hid-sensors: Fix an error handling path in _hid_sensor_set_report_latency() 2024-10-22 15:56:47 +02:00
dac iio: dac: ad3552r: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig 2024-10-22 15:56:48 +02:00
dummy iio: dummy: iio_simply_dummy_buffer: fix information leak in triggered buffer 2025-01-17 13:34:45 +01:00
filter iio:filter:admv8818: select REGMAP_SPI for ADMV8818 2022-04-04 09:19:01 +01:00
frequency iio: frequency: admv4420: fix missing select REMAP_SPI in Kconfig 2024-11-01 01:55:58 +01:00
gyro iio: gyro: fxas21002c: Fix missing data update in trigger handler 2025-01-17 13:34:46 +01:00
health iio: health: afe4404: Fix oob read in afe4404_[read|write]_raw 2022-11-12 16:30:23 +00:00
humidity i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
imu iio: imu: kmx61: fix information leak in triggered buffer 2025-01-17 13:34:46 +01:00
light iio: light: vcnl4035: fix information leak in triggered buffer 2025-01-17 13:34:46 +01:00
magnetometer iio: magnetometer: yas530: use signed integer type for clamp limits 2024-12-14 19:54:31 +01:00
multiplexer iio: multiplexer: Make use of device properties 2022-04-04 09:11:24 +01:00
orientation iio: hid-sensors: bind IIO channels alloc to device object 2021-07-13 18:21:53 +01:00
position iio: hid-sensors: Update header includes 2021-06-16 14:53:13 +01:00
potentiometer iio: potentiometer: mcp4131: Fix alignment for DMA safety 2022-06-14 11:53:19 +01:00
potentiostat i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
pressure iio: pressure: zpa2326: fix information leak in triggered buffer 2025-01-17 13:34:45 +01:00
proximity iio: proximity: mb1232: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig 2024-10-22 15:56:48 +02:00
resolver iio: resolver: ad2s90: Fix alignment for DMA safety 2022-06-14 11:53:19 +01:00
temperature iio: temperature: ltc2983: make bulk write buffer DMA-safe 2022-12-31 13:32:40 +01:00
test iio: test: Mark file local structure arrays static. 2022-08-15 22:30:01 +01:00
trigger iio: trigger: sysfs: fix possible memory leak in iio_sysfs_trig_init() 2022-10-24 18:48:57 +01:00
iio_core.h iio: Mark iio_device_type as const 2021-11-17 17:51:35 +00:00
iio_core_trigger.h iio: core-trigger: make iio_device_register_trigger_consumer() an int return 2021-03-11 20:47:02 +00:00
industrialio-buffer.c iio: buffer: make sure O_NONBLOCK is respected 2023-04-13 16:55:27 +02:00
industrialio-configfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
industrialio-core.c driver: iio: add missing checks on iio_info's callback access 2024-09-08 07:53:11 +02:00
industrialio-event.c driver: iio: add missing checks on iio_info's callback access 2024-09-08 07:53:11 +02:00
industrialio-sw-device.c iio: Don't use bare "unsigned" 2022-07-01 11:19:08 +01:00
industrialio-sw-trigger.c iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails 2022-11-12 17:53:35 +00:00
industrialio-trigger.c iio: Add blank lines after declarations. 2022-08-15 22:29:56 +01:00
industrialio-triggered-event.c iio: core: move @id from struct iio_dev to struct iio_dev_opaque 2021-05-17 13:49:13 +01:00
inkern.c iio: inkern: call iio_device_put() only on mapped devices 2025-01-17 13:34:46 +01:00
Kconfig iio: add filter subfolder 2021-12-16 17:29:46 +00:00
Makefile iio: add filter subfolder 2021-12-16 17:29:46 +00:00
TODO iio: add a TODO 2020-03-08 17:28:53 +00:00