[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250531190124.30704d19@jic23-huawei>
Date: Sat, 31 May 2025 19:01:24 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Gyeyoung Baek <gye976@...il.com>
Cc: David Lechner <dlechner@...libre.com>, Nuno Sá
<nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC 2/9] iio: consumer: Define timestamp-related
structures and constants
On Mon, 19 May 2025 23:25:54 +0900
Gyeyoung Baek <gye976@...il.com> wrote:
> Define the required constants and structures on the consumer side.
>
> The `timestamp_enabled` indicates whether a timestamp is grabbed or not.
> This is passed to `iio_triggered_buffer_setup_new()` as an argument.
>
> The `timestamp_type` indicates which handler grabs the timestamp.
> This value is set by `iio_poll_func_register()`.
>
> Signed-off-by: Gyeyoung Baek <gye976@...il.com>
> ---
> include/linux/iio/trigger_consumer.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/include/linux/iio/trigger_consumer.h b/include/linux/iio/trigger_consumer.h
> index 2c05dfad88d7..5e6ff8738386 100644
> --- a/include/linux/iio/trigger_consumer.h
> +++ b/include/linux/iio/trigger_consumer.h
> @@ -13,6 +13,13 @@
> struct iio_dev;
> struct iio_trigger;
>
> +enum iio_timestamp_type {
> + IIO_TIMESTAMP_TYPE_NONE,
> + IIO_TIMESTAMP_TYPE_CONSUMER_TOP_HALF,
> + IIO_TIMESTAMP_TYPE_CONSUMER_BOTTOM_HALF,
> + IIO_TIMESTAMP_TYPE_TRIGGER,
> +};
This needs documentation. I'm struggling even with the series in front of me
to understand what each of these means. The comment below helps somewhat
but we should have it alongside the enum.
> +
> /**
> * struct iio_poll_func - poll function pair
> *
> @@ -26,7 +33,10 @@ struct iio_trigger;
> * @timestamp: some devices need a timestamp grabbed as soon
> * as possible after the trigger - hence handler
> * passes it via here.
> + * @timestamp_type: indicates which handler grabs the timestamp.
> + * @timestamp_enabled: if true, automatically grabs the timestamp.
> **/
> +
> struct iio_poll_func {
> struct iio_dev *indio_dev;
> irqreturn_t (*h)(int irq, void *p);
> @@ -35,6 +45,9 @@ struct iio_poll_func {
> char *name;
> int irq;
> s64 timestamp;
> +
> + enum iio_timestamp_type timestamp_type;
> + bool timestamp_enabled;
> };
>
>
>
Powered by blists - more mailing lists