From 9f421096a16e75d22e69f766206f1bb0dc8fcf90 Mon Sep 17 00:00:00 2001 From: Artur Rojek Date: Sat, 23 Mar 2019 18:28:06 +0100 Subject: iio: inkern: API for reading available iio channel attribute values Extend the inkern API with a function for reading available attribute values of iio channels. Signed-off-by: Artur Rojek Signed-off-by: Jonathan Cameron --- include/linux/iio/consumer.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/linux/iio') diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index 9887f4f8e2a8..b2d34831ed7c 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h @@ -290,6 +290,20 @@ int iio_read_max_channel_raw(struct iio_channel *chan, int *val); int iio_read_avail_channel_raw(struct iio_channel *chan, const int **vals, int *length); +/** + * iio_read_avail_channel_attribute() - read available channel attribute values + * @chan: The channel being queried. + * @vals: Available values read back. + * @type: Type of values read back. + * @length: Number of entries in vals. + * @attribute: info attribute to be read back. + * + * Returns an error code, IIO_AVAIL_RANGE or IIO_AVAIL_LIST. + */ +int iio_read_avail_channel_attribute(struct iio_channel *chan, + const int **vals, int *type, int *length, + enum iio_chan_info_enum attribute); + /** * iio_get_channel_type() - get the type of a channel * @channel: The channel being queried. -- cgit v1.2.3