[PATCH] iio: chemical: scd4x: expose timestamp channel
From: Fiona Klute
Date: Thu Dec 18 2025 - 10:12:28 EST
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@xxxxxx>
---
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