[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c61d7f3e169ee5204f795784a686e46613b7aa8.camel@gmail.com>
Date: Fri, 19 Dec 2025 14:46:20 +0000
From: Nuno Sá <noname.nuno@...il.com>
To: Tomas Melin <tomas.melin@...sala.com>, Michael Hennerich
<Michael.Hennerich@...log.com>, Nuno Sa <nuno.sa@...log.com>, Lars-Peter
Clausen <lars@...afoo.de>, Jonathan Cameron <jic23@...nel.org>, David
Lechner <dlechner@...libre.com>, Andy Shevchenko <andy@...nel.org>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] iio: adc: ad9467: make iio backend optional
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@...sala.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á
>
Powered by blists - more mailing lists