[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241130002710.18615-2-vassilisamir@gmail.com>
Date: Sat, 30 Nov 2024 01:27:05 +0100
From: Vasileios Amoiridis <vassilisamir@...il.com>
To: jic23@...nel.org,
lars@...afoo.de
Cc: krzysztof.kozlowski@...aro.org,
nuno.sa@...log.com,
u.kleine-koenig@...libre.com,
abhashkumarjha123@...il.com,
jstephan@...libre.com,
dlechner@...libre.com,
linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org,
vassilisamir@...il.com
Subject: [PATCH RFC 1/6] iio: create accessor for iio_dev->scan_timestamp
"scan_timestamp" is supposed to be an internal member of the iio device
structure. However, there are some drivers that are using it directly.
For that reason, the following accessor is created:
iio_is_soft_ts_enabled()
The goal of this accessor, is to ultimately mark "scan_timestamp" as
a __private member of the struct iio_dev.
Signed-off-by: Vasileios Amoiridis <vassilisamir@...il.com>
---
include/linux/iio/iio.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index ae65890d4567..5661794d1127 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -902,6 +902,15 @@ int iio_active_scan_mask_index(struct iio_dev *indio_dev);
for_each_set_bit((chan), (indio_dev)->active_scan_mask, \
iio_get_masklength(indio_dev))
+/**
+ * iio_is_soft_ts_enabled - Check if the software timestamp is enabled
+ * @indio_dev: the IIO device
+ */
+static inline bool iio_is_soft_ts_enabled(const struct iio_dev *indio_dev)
+{
+ return indio_dev->scan_timestamp;
+}
+
ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals);
int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer,
--
2.43.0
Powered by blists - more mailing lists