[PATCH] iio: adc: xilinx-xadc: Fix sequencer mode in postdisable for dual mux
Andy Shevchenko
andriy.shevchenko at intel.com
Tue Mar 3 07:26:35 PST 2026
On Tue, Mar 03, 2026 at 03:58:43PM +0100, Christofer Jonason wrote:
> 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.
...
> ret = xadc_update_adc_reg(xadc, XADC_REG_CONF1, XADC_CONF1_SEQ_MASK,
> - XADC_CONF1_SEQ_CONTINUOUS);
> + seq_mode);
The indentation can be also amended while at it.
> if (ret)
> return ret;
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list