[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250519-timestamp-v1-2-fcb4f6c2721c@gmail.com>
Date: Mon, 19 May 2025 23:25:54 +0900
From: Gyeyoung Baek <gye976@...il.com>
To: Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>
Cc: Gyeyoung Baek <gye976@...il.com>,
linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH RFC 2/9] iio: consumer: Define timestamp-related structures and constants
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,
+};
+
/**
* 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;
};
--
2.43.0
Powered by blists - more mailing lists