Linux IIO development
 help / color / mirror / Atom feed
* [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

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