summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJulien Stephan <jstephan@baylibre.com>2024-07-31 09:05:43 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-08-03 12:33:34 +0200
commitd092b6869817208326005df0a656e3bb9724d89f (patch)
treea7bc4d94857914070fb0c1713ef22695a755df30 /include
parentdt-bindings: iio: adc: ad7380: add single-ended compatible parts (diff)
downloadlinux-d092b6869817208326005df0a656e3bb9724d89f.tar.xz
linux-d092b6869817208326005df0a656e3bb9724d89f.zip
iio: core: add function to retrieve active_scan_mask index
Add a function to retrieve the index of the active scan mask inside the available scan masks array. As in iio_scan_mask_match and iio_sanity_check_avail_scan_masks, this function does not handle multi-long masks correctly. It only checks the first long to be zero, and will use such mask as a terminator even if there was bits set after the first long. This should be fine since the available_scan_mask has already been sanity tested using iio_sanity_check_avail_scan_masks. See iio_scan_mask_match and iio_sanity_check_avail_scan_masks for more details Signed-off-by: Julien Stephan <jstephan@baylibre.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240731-ad7380-add-single-ended-chips-v2-2-cd63bf05744c@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/iio/iio.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index f6c0499853bb..3a735a9a9eae 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -864,6 +864,8 @@ static inline unsigned int iio_get_masklength(const struct iio_dev *indio_dev)
return ACCESS_PRIVATE(indio_dev, masklength);
}
+int iio_active_scan_mask_index(struct iio_dev *indio_dev);
+
/**
* iio_for_each_active_channel - Iterated over active channels
* @indio_dev: the IIO device