Re: [PATCH 1/2] iio: light: ltr390: Add sysfs attribute to report data freshness

From: David Lechner
Date: Thu Jul 24 2025 - 13:42:00 EST


On 7/24/25 11:55 AM, Akshay Jindal wrote:
> On Thu, Jul 24, 2025 at 6:09 PM Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
>> Agreed. Is the interrupt wired on this board? If it is and you
>> want to do filtering with the knowledge that the data is fresh then
>> add a data ready trigger and buffered capture support.
>> It's a much bigger job, but it is standard ABI and as such of more
>> general use.
>>
>> Jonathan
>>
> Yes, the interrupt is wired in and enabled.
>
> For LTR390, data_freshness is not the same as data-ready.
> Here the sensor does not support a data-ready interrupt.
> It only supports threshold violation interrupts where thresholds are
> configurable.
> LTR390 datasheet Pg 17:
> https://optoelectronics.liteon.com/upload/download/DS86-2015-0004/LTR-390UV_Final_%20DS_V1%201.pdf
>
> Correct me, if I am wrong, but as per my understanding, trigger based interrupts
> are more appropriate where the application requires storing multiple samples
> in a buffer at specific time intervals, provided the sensor supports
> data-ready interrupts.
>

Interrupts works just as well for single samples when devices have a
data ready signal. But you are right, that doesn't help us here
since the interrupt is just for threshold alerts.