RE: [PATCH v12 5/6] iio: adc: ad4691: add oversampling support
From: Sabau, Radu bogdan
Date: Thu May 21 2026 - 07:36:17 EST
> -----Original Message-----
> From: Radu Sabau via B4 Relay <devnull+radu.sabau.analog.com@xxxxxxxxxx>
> Sent: Tuesday, May 19, 2026 3:20 PM
...
>
> + iio_for_each_active_channel(indio_dev, bit) {
> + ret = regmap_write(st->regmap,
> AD4691_ACC_DEPTH_IN(bit), st->osr[bit]);
Unfortunately enough, I think a v13 will come, too...
Had a look again on what Sashiko had to say, and seeing the sampling frequency
shared_by_all comment again made me have a deeper look see how the code could
be commented so he wouldn't complain about this anymore, and...
Perhaps he is a bit right after all. I found a section stating that in standard
sequencer mode (which the driver uses right now), all the channels actually use
the ACC_DEPTH_IN0 for osr, and so changing ACC_DEPTH_INn for other channels
doesn't really do much. And so I tested this selecting both voltage0 and voltage1
for sampling with osr4 for voltage0 and osr1 for voltage1 and with a 100kHz osc freq
indeed DR fell after approximately 80us which points out both channels were actually
using OSR of 4. Perhaps the OSR should be shared by all and therefore the
sampling frequency would also be shared by all, right?
The usage of internal_osc_freq and pre-computed freq values depending on osr would
stay the same since those are still correct anyway.
What's your opinion on this?
Radu