From: David Lechner <dlechner@baylibre.com>
To: Tomas Melin <tomas.melin@vaisala.com>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Nuno Sa <nuno.sa@analog.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Jonathan Cameron <jic23@kernel.org>,
Andy Shevchenko <andy@kernel.org>,
Olivier Moysan <olivier.moysan@foss.st.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] iio: adc: ad9467: check for backend capabilities
Date: Tue, 13 Jan 2026 09:19:57 -0600 [thread overview]
Message-ID: <f92e41e6-ab01-4693-8d0e-d5a9df6f6c6b@baylibre.com> (raw)
In-Reply-To: <20260113-b4-ad9467-optional-backend-v2-3-0a27e7e72f41@vaisala.com>
On 1/13/26 6:12 AM, Tomas Melin wrote:
> For cases when the backend does not support test patterns or calibration,
> do not attempt to use those features.
>
> Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
> ---
> drivers/iio/adc/ad9467.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
> index 9cfe66425d4e91e215cccc40e24a92c5e99e9b87..ce7dde8b79540bb0eabfba9470b3984e8723d4b7 100644
> --- a/drivers/iio/adc/ad9467.c
> +++ b/drivers/iio/adc/ad9467.c
> @@ -645,6 +645,9 @@ static int ad9467_backend_testmode_on(struct ad9467_state *st,
> };
> int ret;
>
> + if (!iio_backend_caps(st->back, IIO_BACKEND_CAP_TEST_PATTERNS))
> + return 0;
> +
> ret = iio_backend_data_format_set(st->back, chan, &data);
> if (ret)
> return ret;
> @@ -665,6 +668,9 @@ static int ad9467_backend_testmode_off(struct ad9467_state *st,
> };
> int ret;
>
> + if (!iio_backend_caps(st->back, IIO_BACKEND_CAP_TEST_PATTERNS))
> + return 0;
> +
> ret = iio_backend_chan_disable(st->back, chan);
> if (ret)
> return ret;
> @@ -807,6 +813,9 @@ static int ad9467_calibrate(struct ad9467_state *st)
> bool invert = false, stat;
> int ret;
>
> + if (!iio_backend_caps(st->back, IIO_BACKEND_CAP_CALIBRATION))
> + return 0;
> +
> /* all points invalid */
> bitmap_fill(st->calib_map, st->calib_map_size);
>
>
Same comments from my review of patch 2 apply here.
prev parent reply other threads:[~2026-01-13 15:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 12:12 [PATCH v2 0/3] iio: adc: ad9467: Support alternative backends Tomas Melin
2026-01-13 12:12 ` [PATCH v2 1/3] iio: adc: ad9467: include two's complement in default mode Tomas Melin
2026-01-13 21:04 ` Andy Shevchenko
2026-01-14 7:41 ` Tomas Melin
2026-01-13 12:12 ` [PATCH v2 2/3] iio: industrialio-backend: support backend capabilities Tomas Melin
2026-01-13 15:18 ` David Lechner
2026-01-14 7:29 ` Tomas Melin
2026-01-13 21:06 ` Andy Shevchenko
2026-01-14 7:39 ` Tomas Melin
2026-01-14 7:51 ` Andy Shevchenko
2026-01-13 12:12 ` [PATCH v2 3/3] iio: adc: ad9467: check for " Tomas Melin
2026-01-13 15:19 ` David Lechner [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=f92e41e6-ab01-4693-8d0e-d5a9df6f6c6b@baylibre.com \
--to=dlechner@baylibre.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.com \
--cc=tomas.melin@vaisala.com \
/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
all inboxes | Powered by JetHome®