From: "Nuno Sá" <noname.nuno@gmail.com>
To: Jonathan Santos <Jonathan.Santos@analog.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Michael.Hennerich@analog.com, lars@metafoo.de, jic23@kernel.org,
dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org
Subject: Re: [PATCH 2/3] iio: adc: ad7768-1: prevent one-shot mode with wideband filter
Date: Wed, 04 Feb 2026 16:11:37 +0000 [thread overview]
Message-ID: <4eacb9b5e846b74df5ebb02f1c77135fb1b2fa0f.camel@gmail.com> (raw)
In-Reply-To: <fc00e0592c79bd301cc29dc36731241ecadb9f53.1769889074.git.Jonathan.Santos@analog.com>
On Sat, 2026-01-31 at 22:35 -0300, Jonathan Santos wrote:
> The AD7768-1 datasheet specifies that the wideband low ripple FIR filter
> is only available in continuous conversion mode and should not be used
> with one-shot mode to avoid malfunction and incorrect data.
>
> Add filter type checks in ad7768_scan_direct() to skip one-shot mode
> switching when wideband filter is configured.
>
> Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
> ---
> drivers/iio/adc/ad7768-1.c | 25 +++++++++++++++----------
> 1 file changed, 15 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/iio/adc/ad7768-1.c b/drivers/iio/adc/ad7768-1.c
> index 8d39b71703ae..374614ea97ac 100644
> --- a/drivers/iio/adc/ad7768-1.c
> +++ b/drivers/iio/adc/ad7768-1.c
> @@ -463,14 +463,17 @@ static int ad7768_scan_direct(struct iio_dev *indio_dev)
> struct ad7768_state *st = iio_priv(indio_dev);
> int readval, ret;
>
> - ret = ad7768_set_mode(st, AD7768_ONE_SHOT);
> - if (ret < 0)
> - return ret;
> + /* Wideband filter is not available in One-Shot conversion mode */
> + if (st->filter_type != AD7768_FILTER_WIDEBAND) {
> + ret = ad7768_set_mode(st, AD7768_ONE_SHOT);
> + if (ret < 0)
> + return ret;
>
> - /* One-shot mode requires a SYNC pulse to generate a new sample */
> - ret = ad7768_send_sync_pulse(st);
> - if (ret)
> - return ret;
> + /* One-shot mode requires a SYNC pulse to generate a new sample */
> + ret = ad7768_send_sync_pulse(st);
> + if (ret)
> + return ret;
> + }
>
> reinit_completion(&st->completion);
>
> @@ -496,9 +499,11 @@ static int ad7768_scan_direct(struct iio_dev *indio_dev)
> * Any SPI configuration of the AD7768-1 can only be
> * performed in continuous conversion mode.
> */
> - ret = ad7768_set_mode(st, AD7768_CONTINUOUS);
> - if (ret < 0)
> - return ret;
> + if (st->filter_type != AD7768_FILTER_WIDEBAND) {
> + ret = ad7768_set_mode(st, AD7768_CONTINUOUS);
> + if (ret < 0)
> + return ret;
> + }
So the idea is to still have continuous mode running and get the latest sample after
we do reinit_completion()? If that's the case, why do we have the one shot logic? Does
it bring that much added value? Asking because I'm just wondering we could just let
it in continuous mode all the time.
This also sounds like a fix so maybe a Fixes tag?
- Nuno Sá
next prev parent reply other threads:[~2026-02-04 16:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-01 1:35 [PATCH 0/3] iio: adc: ad7768-1: add support for SPI offload Jonathan Santos
2026-02-01 1:35 ` [PATCH 1/3] iio: adc: ad7768-1: fix one-shot mode data acquisition Jonathan Santos
2026-02-07 16:48 ` Jonathan Cameron
2026-02-09 21:38 ` Jonathan Santos
2026-02-14 14:47 ` Jonathan Cameron
2026-02-01 1:35 ` [PATCH 2/3] iio: adc: ad7768-1: prevent one-shot mode with wideband filter Jonathan Santos
2026-02-04 16:11 ` Nuno Sá [this message]
2026-02-02 22:41 ` Jonathan Santos
2026-02-01 1:35 ` [PATCH 3/3] iio: adc: ad7768-1: add support for SPI offload Jonathan Santos
2026-02-04 14:09 ` Andy Shevchenko
2026-02-04 15:38 ` David Lechner
2026-02-05 5:42 ` kernel test robot
2026-02-05 6:03 ` Dan Carpenter
2026-02-05 6:44 ` kernel test robot
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=4eacb9b5e846b74df5ebb02f1c77135fb1b2fa0f.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=Jonathan.Santos@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--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 \
/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
Powered by JetHome