Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "ILYAS NHASSE" <ilyas.nhasse@skf.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 2/2] iio: adc: ad_sigma_delta: support devices without RDY interrupt
Date: Fri, 20 Nov 2026 11:45:47 +0000	[thread overview]
Message-ID: <sashiko-outbox-225093@kernel.org> (raw)
In-Reply-To: <20261120-ad7124-no-irq-v1-2-7826c5c3fd25@skf.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] iio: adc: ad_sigma_delta: ad_sd_init() rejects missing rdy
  IRQ on named-IRQ chips
--

commit 87e803058ca4873e10b22ef0a9b56f4fa07e3e6e
Author: ILYAS NHASSE <ilyas.nhasse@skf.com>

iio: adc: ad_sigma_delta: support devices without RDY interrupt

This commit adds polled status-register support in direct mode and
calibration for register-based sigma-delta ADCs wired without an RDY
interrupt.

> diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
> index 119ddc5a13e27..546135995bbf7 100644
> --- a/drivers/iio/adc/ad_sigma_delta.c
> +++ b/drivers/iio/adc/ad_sigma_delta.c
[ ... ]
> @@ -816,12 +845,18 @@ static int devm_ad_sd_probe_trigger(struct device *dev, struct iio_dev *indio_de
>   * devm_ad_sd_setup_buffer_and_trigger() - Device-managed buffer & trigger setup
>   * @dev: Device object to which to bind the life-time of the resources attached
>   * @indio_dev: The IIO device
> + *
> + * Nothing is set up for devices with registers but without R̅D̅Y̅ interrupt:
> + * they only support direct mode, with polled conversions.
>   */
>  int devm_ad_sd_setup_buffer_and_trigger(struct device *dev, struct iio_dev *indio_dev)
>  {
>  	struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev);
>  	int ret;
>  
> +	if (!sigma_delta->irq_line && sigma_delta->info->has_registers)
> +		return 0;

[Severity: Medium]
Can sigma_delta->irq_line ever be 0 on register-based devices that set
info->has_named_irqs = true (such as the AD717x and AD411x parts in
drivers/iio/adc/ad7173.c)?

When the optional "rdy" interrupt is omitted in firmware on those devices,
fwnode_irq_get_byname() returns a negative errno (-EINVAL or -ENODATA) and
ad_sd_init() aborts probe before reaching the polled path:

drivers/iio/adc/ad_sigma_delta.c:ad_sd_init() {
    ...
	if (info->has_named_irqs) {
		sigma_delta->irq_line = fwnode_irq_get_byname(dev_fwnode(&spi->dev),
							      "rdy");
		if (sigma_delta->irq_line < 0)
			return dev_err_probe(&spi->dev, sigma_delta->irq_line,
					     "Interrupt 'rdy' is required\n");
	} else {
		sigma_delta->irq_line = spi->irq;
	}
    ...
}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-ad7124-no-irq-v1-0-7826c5c3fd25@skf.com?part=2

      reply	other threads:[~2026-11-20 11:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 11:26 [PATCH 0/2] iio: adc: ad7124: support boards without RDY interrupt ILYAS NHASSE via B4 Relay
2026-11-20 11:26 ` [PATCH 1/2] dt-bindings: iio: adc: adi,ad7124: make interrupts optional ILYAS NHASSE via B4 Relay
2026-11-20 11:26 ` [PATCH 2/2] iio: adc: ad_sigma_delta: support devices without RDY interrupt ILYAS NHASSE via B4 Relay
2026-11-20 11:45   ` sashiko-bot [this message]

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=sashiko-outbox-225093@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ilyas.nhasse@skf.com \
    --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