summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRupesh Majhi <zoone.rupert@gmail.com>2026-09-21 21:31:28 +0300
committerJonathan Cameron <jonathan.cameron@oss.qualcomm.com>2026-09-28 17:07:37 +0100
commit47086bd263d31cc2caad30ed0cc60fa9dd9a7b41 (patch)
tree9816f937beff8c646e307a83b7db3f1ab14e4e9b /include/linux
parent9b7cad9ce2ed2892debd96ce9d84f82b5ae1e08a (diff)
iio: core: add an accessor for scan_timestamp
indio_dev->scan_timestamp is __private, so a driver has no way to ask whether the timestamp channel is in the current scan. Hide the ACCESS_PRIVATE() behind a read-only helper, the way iio_get_masklength() already does. The dps310 FIFO patch later in this series is the first user: that hardware does not timestamp entries, so it refuses a buffer with the timestamp channel enabled. Suggested-by: Jonathan Cameron <jic23@kernel.org> Assisted-by: LLM Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/iio/iio.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 4b16049e615a..9b63785d5aec 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -1095,6 +1095,15 @@ static inline unsigned int iio_get_masklength(const struct iio_dev *indio_dev)
return ACCESS_PRIVATE(indio_dev, masklength);
}
+/**
+ * iio_scan_timestamp_enabled - Is the timestamp channel in the current scan
+ * @indio_dev: the IIO device to check
+ */
+static inline bool iio_scan_timestamp_enabled(const struct iio_dev *indio_dev)
+{
+ return ACCESS_PRIVATE(indio_dev, scan_timestamp);
+}
+
int iio_active_scan_mask_index(struct iio_dev *indio_dev);
/**