[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a88e1a8e-d29c-41e7-b3cd-5db965a055df@baylibre.com>
Date: Mon, 21 Jul 2025 15:25:38 -0500
From: David Lechner <dlechner@...libre.com>
To: Akshay Jindal <akshayaj.lkd@...il.com>, anshulusr@...il.com,
jic23@...nel.org, nuno.sa@...log.com, andy@...nel.org
Cc: shuah@...nel.org, linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] iio: light: ltr390: Add sysfs attribute to report
data freshness
On 7/21/25 2:54 PM, Akshay Jindal wrote:
> Some IIO sensors provide a status bit indicating whether the current data
> register holds freshly measured data or stale data previously read.
>
> Expose this status via a new read-only sysfs attribute, 'data_fresh',
> which returns:
> - 1 if the data is freshly sampled
> - 0 if the data is stale
>
> This attribute allows userspace to observe data freshness directly, which
> can be useful for debugging or application-level filtering.
For debugging, using debugfs would make more sense.
For application level filtering, why does it matter if we have
read the same value before or not? The sampling_frequency is
available, so the application should be able to deduce when
fresh data should be available based on time.
I could see maybe polling this in the kernel in order to implement
a buffered capture mode, but not sure passing this on to userspace
is the best way to go about it.
Powered by blists - more mailing lists