]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: adc: xilinx-xadc: Fix sequencer mode in postdisable for dual mux
authorChristofer Jonason <christofer.jonason@guidelinegeo.com>
Wed, 4 Mar 2026 09:07:27 +0000 (10:07 +0100)
committerJonathan Cameron <jic23@kernel.org>
Tue, 28 Apr 2026 15:36:08 +0000 (16:36 +0100)
commit852534744c2d35626a604f128ff0b8ec12805591
tree5e015db811a37255cf8a42d772659679bf284d5e
parent254f49634ee16a731174d2ae34bc50bd5f45e731
iio: adc: xilinx-xadc: Fix sequencer mode in postdisable for dual mux

xadc_postdisable() unconditionally sets the sequencer to continuous
mode. For dual external multiplexer configurations this is incorrect:
simultaneous sampling mode is required so that ADC-A samples through
the mux on VAUX[0-7] while ADC-B simultaneously samples through the
mux on VAUX[8-15]. In continuous mode only ADC-A is active, so
VAUX[8-15] channels return incorrect data.

Since postdisable is also called from xadc_probe() to set the initial
idle state, the wrong sequencer mode is active from the moment the
driver loads.

The preenable path already uses xadc_get_seq_mode() which returns
SIMULTANEOUS for dual mux. Fix postdisable to do the same.

Fixes: bdc8cda1d010 ("iio:adc: Add Xilinx XADC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Christofer Jonason <christofer.jonason@guidelinegeo.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Salih Erim <salih.erim@amd.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/xilinx-xadc-core.c