* [PATCH] iio: chemical: scd4x: expose timestamp channel
@ 2025-12-18 15:12 Fiona Klute
2025-12-21 18:05 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Fiona Klute @ 2025-12-18 15:12 UTC (permalink / raw)
To: Roan van Dijk, linux-iio
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
linux-kernel, Fiona Klute
Timestamps were already written to the buffer in
scd4x_trigger_handler(), this patch makes them available as a channel.
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
---
drivers/iio/chemical/scd4x.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/iio/chemical/scd4x.c b/drivers/iio/chemical/scd4x.c
index 0fd839176e264..23a326fb62a7e 100644
--- a/drivers/iio/chemical/scd4x.c
+++ b/drivers/iio/chemical/scd4x.c
@@ -59,6 +59,8 @@ enum scd4x_channel_idx {
SCD4X_CO2,
SCD4X_TEMP,
SCD4X_HR,
+ /* kernel timestamp, at the end of buffer */
+ SCD4X_TS,
};
struct scd4x_state {
@@ -615,6 +617,7 @@ static const struct iio_chan_spec scd4x_channels[] = {
.endianness = IIO_CPU,
},
},
+ IIO_CHAN_SOFT_TIMESTAMP(SCD4X_TS),
};
static int scd4x_suspend(struct device *dev)
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: chemical: scd4x: expose timestamp channel
2025-12-18 15:12 [PATCH] iio: chemical: scd4x: expose timestamp channel Fiona Klute
@ 2025-12-21 18:05 ` Jonathan Cameron
2025-12-22 16:39 ` Fiona Klute
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2025-12-21 18:05 UTC (permalink / raw)
To: Fiona Klute
Cc: Roan van Dijk, linux-iio, David Lechner, Nuno Sá,
Andy Shevchenko, linux-kernel
On Thu, 18 Dec 2025 16:12:05 +0100
Fiona Klute <fiona.klute@gmx.de> wrote:
> Timestamps were already written to the buffer in
> scd4x_trigger_handler(), this patch makes them available as a channel.
>
> Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Applied to the togreg branch of iio.git. Initially pushed out as testing
to let 0-day have a brief look at it.
Thanks,
Jonathan
> ---
> drivers/iio/chemical/scd4x.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/iio/chemical/scd4x.c b/drivers/iio/chemical/scd4x.c
> index 0fd839176e264..23a326fb62a7e 100644
> --- a/drivers/iio/chemical/scd4x.c
> +++ b/drivers/iio/chemical/scd4x.c
> @@ -59,6 +59,8 @@ enum scd4x_channel_idx {
> SCD4X_CO2,
> SCD4X_TEMP,
> SCD4X_HR,
> + /* kernel timestamp, at the end of buffer */
> + SCD4X_TS,
> };
>
> struct scd4x_state {
> @@ -615,6 +617,7 @@ static const struct iio_chan_spec scd4x_channels[] = {
> .endianness = IIO_CPU,
> },
> },
> + IIO_CHAN_SOFT_TIMESTAMP(SCD4X_TS),
> };
>
> static int scd4x_suspend(struct device *dev)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: chemical: scd4x: expose timestamp channel
2025-12-21 18:05 ` Jonathan Cameron
@ 2025-12-22 16:39 ` Fiona Klute
0 siblings, 0 replies; 3+ messages in thread
From: Fiona Klute @ 2025-12-22 16:39 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Roan van Dijk, linux-iio, David Lechner, Nuno Sá,
Andy Shevchenko, linux-kernel
Am 21.12.25 um 19:05 schrieb Jonathan Cameron:
> On Thu, 18 Dec 2025 16:12:05 +0100
> Fiona Klute <fiona.klute@gmx.de> wrote:
>
>> Timestamps were already written to the buffer in
>> scd4x_trigger_handler(), this patch makes them available as a channel.
>>
>> Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
> Applied to the togreg branch of iio.git. Initially pushed out as testing
> to let 0-day have a brief look at it.
Thank you! Could you also pick my channel endianness fix for the scd4x
driver [1]? The patches apply independently, but timestamps aren't going
to be very useful as long as the data that goes with them is incorrect.
Or does that need to go via a different tree as a bugfix?
Best regards,
Fiona
[1]
https://lore.kernel.org/linux-iio/20251213163226.1678707-1-fiona.klute@gmx.de/T/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-22 16:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18 15:12 [PATCH] iio: chemical: scd4x: expose timestamp channel Fiona Klute
2025-12-21 18:05 ` Jonathan Cameron
2025-12-22 16:39 ` Fiona Klute
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox