mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Akshay Jindal <akshayaj.lkd@gmail.com>,
	anshulusr@gmail.com, jic23@kernel.org, nuno.sa@analog.com,
	andy@kernel.org
Cc: shuah@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: light: ltr390: Add sysfs attribute to report data freshness
Date: Mon, 21 Jul 2025 15:25:38 -0500	[thread overview]
Message-ID: <a88e1a8e-d29c-41e7-b3cd-5db965a055df@baylibre.com> (raw)
In-Reply-To: <20250721195419.526920-1-akshayaj.lkd@gmail.com>

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.



  parent reply	other threads:[~2025-07-21 20:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21 19:54 Akshay Jindal
2025-07-21 19:54 ` [PATCH 2/2] iio: light: ltr390: Add conditional data freshness check with sysfs control Akshay Jindal
2025-07-24 18:54   ` Akshay Jindal
2025-07-27 20:12     ` Akshay Jindal
2025-07-28 13:45       ` Jonathan Cameron
2025-07-21 20:25 ` David Lechner [this message]
2025-07-22  3:55   ` [PATCH 1/2] iio: light: ltr390: Add sysfs attribute to report data freshness Akshay Jindal
2025-07-22 21:15     ` David Lechner
2025-07-24 12:39       ` Jonathan Cameron
2025-07-24 16:55         ` Akshay Jindal
2025-07-24 17:41           ` David Lechner
2025-07-27 13:12             ` Jonathan Cameron
2025-07-23 14:02 ` Andy Shevchenko

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=a88e1a8e-d29c-41e7-b3cd-5db965a055df@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=akshayaj.lkd@gmail.com \
    --cc=andy@kernel.org \
    --cc=anshulusr@gmail.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=shuah@kernel.org \
    /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

all inboxes | Powered by JetHome®