Re: [PATCH RFC 0/4] iio: add support for multiple scan types

From: Jonathan Cameron
Date: Sat May 25 2024 - 12:19:45 EST


On Tue, 21 May 2024 11:18:24 +0200
Nuno Sá <noname.nuno@xxxxxxxxx> wrote:

> On Tue, 2024-05-07 at 14:02 -0500, David Lechner wrote:
> > Following up from this thread [1]...
> >
> > Unless I've overlooked something important, I think adding support for
> > multiple scan types per channels should be rather trivial, at least in
> > the kernel. Userspace tools will need to learn to re-read buffer _type
> > attributes though. For example, it looks like libiio caches these values.
> > I had to restart iiod to get a proper capture with the iio-oscilloscope
> > after changing the scan type at runtime.
>
> No for now but to add more future fun, we may consider in having something
> similar as hwmon [1]. Hence, userspace could do things like poll(2) on the
> specific file rather than having to read it over and over...
>
> [1]: https://elixir.bootlin.com/linux/latest/source/drivers/hwmon/hwmon.c#L649
> - Nuno Sá
>

It would take a well reasoned usecase to convince me sysfs notifications
are useful in cases where an explicit userspace action caused the value that
would be read from another file to change immediately.

Jonathan