From: sashiko-bot@kernel.org
To: "Radu Sabau via B4 Relay" <devnull+radu.sabau.analog.com@kernel.org>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v13 2/6] iio: adc: ad4691: add initial driver for AD4691 family
Date: Mon, 25 May 2026 10:45:26 +0000 [thread overview]
Message-ID: <20260525104527.2A4841F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260525-ad4692-multichannel-sar-adc-driver-v13-2-1b7626d3b35c@analog.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] Meaningful code and commit message mismatch regarding reset sequence.
- [Medium] Regmap cache is not updated for the lower bytes of 16-bit registers written via SPI auto-decrement, leading to stale cache reads.
- [Medium] AD4691_STATE_RESET_REG is a self-clearing command register but is not marked as volatile, causing it to be incorrectly cached.
--
commit 5d0c7a2b74dca7a38834216ccda12567a51d63dd
Author: Radu Sabau <radu.sabau@analog.com>
iio: adc: ad4691: add initial driver for AD4691 family
This commit adds initial driver support for the Analog Devices AD4691
family of multichannel SAR ADCs.
> Three voltage supply domains are managed: avdd (required), vio, and a
> reference supply on either the REF pin (ref-supply, external buffer)
> or the REFIN pin (refin-supply, uses the on-chip reference buffer;
> REFBUF_EN is set accordingly). Hardware reset is performed by asserting
> the reset-gpios GPIO line for at least 300 µs then deasserting it;
[Severity: Medium]
The commit message states that the hardware reset is performed by asserting
the reset line for at least 300 µs before deasserting it, but the code in
ad4691_reset() asserts, immediately deasserts, and then waits 300 µs. Is
this description accurate?
> diff --git a/drivers/iio/adc/ad4691.c b/drivers/iio/adc/ad4691.c
> new file mode 100644
> index 0000000000000..cc1e2ef6bfd8b
> --- /dev/null
> +++ b/drivers/iio/adc/ad4691.c
[ ... ]
> +static bool ad4691_volatile_reg(struct device *dev, unsigned int reg)
> +{
> + switch (reg) {
> + case AD4691_STATUS_REG:
> + case AD4691_CLAMP_STATUS1_REG:
> + case AD4691_CLAMP_STATUS2_REG:
> + case AD4691_GPIO_READ:
> + case AD4691_ACC_STATUS_FULL1_REG ... AD4691_ACC_STATUS_SAT2_REG:
> + case AD4691_ACC_SAT_OVR_REG(0) ... AD4691_ACC_SAT_OVR_REG(15):
> + return true;
[Severity: Medium]
Does AD4691_STATE_RESET_REG need to be marked as volatile here?
It is used as a self-clearing command register in ad4691_single_shot_read(),
so caching it might return a stale '1' on reads and potentially trigger
spurious resets if the cache is ever synced.
[ ... ]
> +static int ad4691_single_shot_read(struct iio_dev *indio_dev,
> + struct iio_chan_spec const *chan, int *val)
> +{
[ ... ]
> + ret = regmap_write(st->regmap, AD4691_STD_SEQ_CONFIG,
> + BIT(chan->channel));
> + if (ret)
> + return ret;
> +
> + ret = regmap_write(st->regmap, AD4691_ACC_MASK_REG,
> + ~BIT(chan->channel) & GENMASK(15, 0));
[Severity: Medium]
Since AD4691_ACC_MASK_REG and AD4691_STD_SEQ_CONFIG use an ADDR_DESCENDING
SPI write where the hardware auto-decrements the address for the second byte,
will the regmap cache for the lower address (e.g., 0x184 for the mask) remain
stale because regmap_write() only updates the cache for the base address?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260525-ad4692-multichannel-sar-adc-driver-v13-0-1b7626d3b35c@analog.com?part=2
next prev parent reply other threads:[~2026-05-25 10:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 10:10 [PATCH v13 0/6] iio: adc: ad4691: add driver for AD4691 multichannel SAR ADC family Radu Sabau via B4 Relay
2026-05-25 10:10 ` [PATCH v13 1/6] dt-bindings: iio: adc: add AD4691 family Radu Sabau via B4 Relay
2026-05-25 10:16 ` sashiko-bot
2026-05-25 10:10 ` [PATCH v13 2/6] iio: adc: ad4691: add initial driver for " Radu Sabau via B4 Relay
2026-05-25 10:45 ` sashiko-bot [this message]
2026-05-25 10:10 ` [PATCH v13 3/6] iio: adc: ad4691: add triggered buffer support Radu Sabau via B4 Relay
2026-05-25 11:29 ` sashiko-bot
2026-05-25 12:02 ` Sabau, Radu bogdan
2026-05-25 12:31 ` Sabau, Radu bogdan
2026-05-25 10:10 ` [PATCH v13 4/6] iio: adc: ad4691: add SPI offload support Radu Sabau via B4 Relay
2026-05-25 12:26 ` sashiko-bot
2026-05-25 10:10 ` [PATCH v13 5/6] iio: adc: ad4691: add oversampling support Radu Sabau via B4 Relay
2026-05-25 13:06 ` sashiko-bot
2026-05-25 10:10 ` [PATCH v13 6/6] docs: iio: adc: ad4691: add driver documentation Radu Sabau via B4 Relay
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=20260525104527.2A4841F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=devnull+radu.sabau.analog.com@kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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