From 47086bd263d31cc2caad30ed0cc60fa9dd9a7b41 Mon Sep 17 00:00:00 2001 From: Rupesh Majhi Date: Mon, 21 Sep 2026 21:31:28 +0300 Subject: 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 Assisted-by: LLM Signed-off-by: Rupesh Majhi Signed-off-by: Jonathan Cameron --- include/linux/iio/iio.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/linux') 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); /** -- cgit v1.2.3