iio: Introduce iio_validate_scan_mask_onehot

Add a helper function for validating a scan mask for devices where exactly one
channel must be selected during sampling. This is a common case among devices
which have scan mask restrictions so it makes sense to provide this function in
the core.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Lars-Peter Clausen
2012-07-09 10:00:00 +01:00
committed by Jonathan Cameron
parent 939546d1a9
commit 8163663205
2 changed files with 19 additions and 0 deletions

View File

@@ -177,6 +177,9 @@ ssize_t iio_buffer_show_enable(struct device *dev,
int iio_sw_buffer_preenable(struct iio_dev *indio_dev);
bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev,
const unsigned long *mask);
#else /* CONFIG_IIO_BUFFER */
static inline int iio_buffer_register(struct iio_dev *indio_dev,