Re: [PATCH] iio: chemical: scd4x: expose timestamp channel
From: Jonathan Cameron
Date: Sun Dec 21 2025 - 13:05:17 EST
On Thu, 18 Dec 2025 16:12:05 +0100
Fiona Klute <fiona.klute@xxxxxx> 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@xxxxxx>
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)