diff options
author | Matt Ranostay <mranostay@gmail.com> | 2016-09-24 09:04:07 +0300 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-09-27 22:33:02 +0300 |
commit | 0023e67dd8951737588b8af0469446df3ec52afe (patch) | |
tree | 2d7fdc82668d9964f2b406f7d604e6f37f361ded /include | |
parent | 2a20af722dde611b6b060af18dff651a8db96073 (diff) | |
download | linux-0023e67dd8951737588b8af0469446df3ec52afe.tar.xz |
iio: inkern: add iio_read_channel_offset helper
Allow access to underlying channel IIO_CHAN_INFO_OFFSET from a consumer.
Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/iio/consumer.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index 9edccfba1ffb..638157234357 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h @@ -236,6 +236,19 @@ int iio_get_channel_type(struct iio_channel *channel, enum iio_chan_type *type); /** + * iio_read_channel_offset() - read the offset value for a channel + * @chan: The channel being queried. + * @val: First part of value read back. + * @val2: Second part of value read back. + * + * Note returns a description of what is in val and val2, such + * as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val + * + val2/1e6 + */ +int iio_read_channel_offset(struct iio_channel *chan, int *val, + int *val2); + +/** * iio_read_channel_scale() - read the scale value for a channel * @chan: The channel being queried. * @val: First part of value read back. |