public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.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>,
	David Lechner	 <dlechner@baylibre.com>,
	Andy Shevchenko <andy@kernel.org>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: adc: ad9467: make iio backend optional
Date: Fri, 19 Dec 2025 14:46:20 +0000	[thread overview]
Message-ID: <2c61d7f3e169ee5204f795784a686e46613b7aa8.camel@gmail.com> (raw)
In-Reply-To: <e095bc11-9986-40bb-8ad2-967ee85f67e9@vaisala.com>

On Fri, 2025-12-19 at 13:16 +0200, Tomas Melin wrote:
> 
> On 18/12/2025 15:49, Nuno Sá wrote:
> > On Tue, 2025-12-16 at 11:40 +0000, Tomas Melin wrote:
> > > Not all users can or want to use the device with an iio-backend.
> > > For these users, let the driver work in standalone mode, not coupled
> > > to the backend or the services it provides.
> > > 
> > > Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
> > > ---
> > >  drivers/iio/adc/ad9467.c | 37 +++++++++++++++++++++++++------------
> > >  1 file changed, 25 insertions(+), 12 deletions(-)
> > > 
> > > diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
> > > index 60fc3361b2689a4c38287c613ef93fe00338e5fa..37b8f88da6681d44f3fbbb6c8c171ae7117b9090
> > > 100644
> > > --- a/drivers/iio/adc/ad9467.c
> > > +++ b/drivers/iio/adc/ad9467.c
> > > @@ -1000,6 +1000,9 @@ static int ad9467_update_scan_mode(struct iio_dev *indio_dev,
> > >  	unsigned int c;
> > >  	int ret;
> > >  
> > > +	if (!st->back)
> > > +		return -EOPNOTSUPP;
> > > +
> > 
> > Let's not add the buffering interface if we can't control it.
> > Having it just to return error does not make sense to me. This means yet another info:
> > 
> > https://elixir.bootlin.com/linux/v6.18.1/source/drivers/iio/adc/ad9467.c#L916
> > 
> 
> I agree, not having the scan_mode at all would be more clean.
> But adding those different iio_info structs comes across as a bit messy.
> Would it make sense to create that iio_info dynamically in the probe and
> fill out the callbacks that are supported for the configuration we
> encounter? I could try out something like that and see how it would look
> like in practice.
> 

Hmm yeah, it's not just one more iio_info we need but 2. But maybe let's keep it simple
and remove the check in ad9467_update_scan_mode(). I mean, if I'm not missing nothing, 
if there's no buffer, there's no real way for userspace to reach that code path.

- Nuno Sá

> 

  reply	other threads:[~2025-12-19 14:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16 11:40 [PATCH 0/2] iio: adc: ad9467: Enable operation without iio-backend Tomas Melin
2025-12-16 11:40 ` [PATCH 1/2] iio: adc: ad9467: include two's complement in default mode Tomas Melin
2025-12-18 13:43   ` Nuno Sá
2025-12-20  3:28   ` kernel test robot
2025-12-20  5:13   ` kernel test robot
2025-12-21 19:54   ` Jonathan Cameron
2025-12-16 11:40 ` [PATCH 2/2] iio: adc: ad9467: make iio backend optional Tomas Melin
2025-12-16 12:56   ` Nuno Sá
2025-12-16 15:39     ` Tomas Melin
2025-12-16 21:27       ` David Lechner
2025-12-17  5:38         ` Tomas Melin
2025-12-17  9:26       ` Nuno Sá
2025-12-17 10:39         ` Tomas Melin
2025-12-17 11:44         ` Tomas Melin
2025-12-18 13:41           ` Nuno Sá
2025-12-19 11:25             ` Tomas Melin
2025-12-18 13:49   ` Nuno Sá
2025-12-19 11:16     ` Tomas Melin
2025-12-19 14:46       ` Nuno Sá [this message]
2025-12-21 20:00   ` Jonathan Cameron
2026-01-05 11:06     ` Tomas Melin
2026-01-05 14:57       ` Nuno Sá
2026-01-11 11:41         ` Jonathan Cameron
2026-01-12 13:21           ` Nuno Sá
2026-01-13  7:47             ` Tomas Melin
2026-01-13 10:00               ` Jonathan Cameron
2026-01-13 10:52               ` Nuno Sá
2026-01-13 11:49                 ` Tomas Melin
2026-01-13 12:44                   ` Nuno Sá

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=2c61d7f3e169ee5204f795784a686e46613b7aa8.camel@gmail.com \
    --to=noname.nuno@gmail.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 \
    --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