RE: [PATCH v13 3/6] iio: adc: ad4691: add triggered buffer support
From: Sabau, Radu bogdan
Date: Mon May 25 2026 - 08:03:14 EST
> -----Original Message-----
> From: Radu Sabau via B4 Relay <devnull+radu.sabau.analog.com@xxxxxxxxxx>
> Sent: Monday, May 25, 2026 1:10 PM
...
> + * ad4691_exit_conversion_mode - Return the chip to AUTONOMOUS mode.
> + *
> + * Called from buffer postdisable to restore the chip to the
> + * idle state used by read_raw. Clears the sequencer and resets state.
> + */
> +static int ad4691_exit_conversion_mode(struct ad4691_state *st)
> +{
> + if (st->manual_mode)
> + return regmap_update_bits(st->regmap,
> AD4691_DEVICE_SETUP,
> + AD4691_MANUAL_MODE, 0);
Once again, and I hate to say this, a follow-up patch will be required.
Somewhere along the patch versions ad4691_transfer which was used for
removed functionality from the driver was removed and was used to send
0x5000 (SPI command to exit MANUAL MODE and come back into
Autonomous Mode which in Manual Mode is used for raw_reading).
At the time being this is a bug that means once using the buffer and stopping
it, register access to the device doesn't really exist anymore and the SPI operations
used for register access can not be relied on.
I am very sorry for finding this out just now, I guess I focused too much on OSR and
CNV Burst Mode lately that I completely forgot about this.
Will leave this patch here to see if any further review comes in and will also take a look
at Sashiko , perhaps he finds something else and a v14 will be needed anyway.