diff mbox series

[RFC,1/6] iio: create accessor for iio_dev->scan_timestamp

Message ID 20241130002710.18615-2-vassilisamir@gmail.com (mailing list archive)
State New
Headers show
Series iio: mark scan_timestamp __private | expand

Commit Message

Vasileios Amoiridis Nov. 30, 2024, 12:27 a.m. UTC
"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@gmail.com>
---
 include/linux/iio/iio.h | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

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,