From: Jonathan Cameron <jic23@kernel.org>
To: "Sabau, Radu bogdan" <Radu.Sabau@analog.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Sa, Nuno" <Nuno.Sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Uwe Kleine-König" <ukleinek@kernel.org>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Linus Walleij" <linusw@kernel.org>,
"Bartosz Golaszewski" <brgl@kernel.org>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pwm@vger.kernel.org" <linux-pwm@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH v12 5/6] iio: adc: ad4691: add oversampling support
Date: Fri, 22 May 2026 12:16:28 +0100 [thread overview]
Message-ID: <20260522121628.21bf03f9@jic23-huawei> (raw)
In-Reply-To: <LV9PR03MB8414CA3DB26235605C9323E5F70E2@LV9PR03MB8414.namprd03.prod.outlook.com>
On Thu, 21 May 2026 11:32:42 +0000
"Sabau, Radu bogdan" <Radu.Sabau@analog.com> wrote:
> > -----Original Message-----
> > From: Radu Sabau via B4 Relay <devnull+radu.sabau.analog.com@kernel.org>
> > 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?
I kind of lost track on the modes. What are the chances we later move to or add
support for a mode where the different OSRs do matter? If that's a possibility
we should avoid ABI change by allowing for it from the start.
Then if we are in this mode, they'll have separate controls but change any, changes
them all, if we are in a different mode that connection breaks.
If that's the case, just throw in a comment saying something to the effect this
may change.
It's not wrong ABI to do this, it's just less intuitive for users which is why
we prefer the shared_by stuff where there isn't a disadvantage. That is at most
a hint to what actually happens. A simple example is where different
channels have one OSR field but they aren't the same - i.e. channel 1 is twice
the OSR of channel 2. Hence we can't share the attribute but any change effects
both.
Jonathan
>
> 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
>
next prev parent reply other threads:[~2026-05-22 11:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 12:20 [PATCH v12 0/6] iio: adc: ad4691: add driver for AD4691 multichannel SAR ADC family Radu Sabau via B4 Relay
2026-05-19 12:20 ` [PATCH v12 1/6] dt-bindings: iio: adc: add AD4691 family Radu Sabau via B4 Relay
2026-05-19 12:28 ` sashiko-bot
2026-05-19 17:26 ` Conor Dooley
2026-05-19 17:26 ` Conor Dooley
2026-05-22 11:23 ` Jonathan Cameron
2026-05-19 12:20 ` [PATCH v12 2/6] iio: adc: ad4691: add initial driver for " Radu Sabau via B4 Relay
2026-05-22 11:35 ` Jonathan Cameron
2026-05-19 12:20 ` [PATCH v12 3/6] iio: adc: ad4691: add triggered buffer support Radu Sabau via B4 Relay
2026-05-19 13:42 ` sashiko-bot
2026-05-22 11:46 ` Jonathan Cameron
2026-05-19 12:20 ` [PATCH v12 4/6] iio: adc: ad4691: add SPI offload support Radu Sabau via B4 Relay
2026-05-19 14:35 ` sashiko-bot
2026-05-19 12:20 ` [PATCH v12 5/6] iio: adc: ad4691: add oversampling support Radu Sabau via B4 Relay
2026-05-19 15:11 ` sashiko-bot
2026-05-21 11:32 ` Sabau, Radu bogdan
2026-05-22 11:16 ` Jonathan Cameron [this message]
2026-05-22 11:38 ` Sabau, Radu bogdan
2026-05-22 13:38 ` Jonathan Cameron
2026-05-19 12:20 ` [PATCH v12 6/6] docs: iio: adc: ad4691: add driver documentation Radu Sabau via B4 Relay
2026-05-22 11:51 ` [PATCH v12 0/6] iio: adc: ad4691: add driver for AD4691 multichannel SAR ADC family Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260522121628.21bf03f9@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=Nuno.Sa@analog.com \
--cc=Radu.Sabau@analog.com \
--cc=andy@kernel.org \
--cc=brgl@kernel.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=ukleinek@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox