diff options
| author | David Lechner <dlechner@baylibre.com> | 2025-05-02 10:42:16 -0500 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2025-05-21 14:20:29 +0100 |
| commit | 017294e5a68ab2d09b380f912b30d36fc81edaa1 (patch) | |
| tree | 01d1cfe96950046b67d63be5c73b2648ab3e73db /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | 6eb974967a86d16bd4d19a9bf4869f4a8b85c572 (diff) | |
iio: adc: ad7606_spi: add offload scan mask check
Validate the scan mask when SPI offloading is being used.
Since this family of ADCs is simultaneous sampling, there isn't a way
to selectively disable channels when reading sample data. (Technically,
AD7616 has a sequencer so the driver could have some control, but that
is for another day).
For "regular" IIO triggered buffer reads, this isn't a problem and the
IIO core will demux the data and ignore data from disabled channels.
However, since SPI offloading is done completely in hardware, we don't
have a way to do the same. So before this patch, if less than all
channels were enabled, the data would be misplaced in the buffer.
By adding a check in update_scan_mode, we can fail to enable the buffer
instead of having bad data returned to userspace.
Fixes: e96d35faf357 ("iio: adc: ad7606: add SPI offload support")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250502-iio-adc-ad7606_spi-fix-offload-scan-mask-check-v2-1-e70c6d71baa3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions
