summaryrefslogtreecommitdiffstats
path: root/include/linux/iio
diff options
context:
space:
mode:
authorMatt Ranostay <mranostay@gmail.com>2016-09-23 23:04:07 -0700
committerJonathan Cameron <jic23@kernel.org>2016-09-27 20:33:02 +0100
commit0023e67dd8951737588b8af0469446df3ec52afe (patch)
tree2d7fdc82668d9964f2b406f7d604e6f37f361ded /include/linux/iio
parent2a20af722dde611b6b060af18dff651a8db96073 (diff)
downloadop-kernel-dev-0023e67dd8951737588b8af0469446df3ec52afe.zip
op-kernel-dev-0023e67dd8951737588b8af0469446df3ec52afe.tar.gz
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/linux/iio')
-rw-r--r--include/linux/iio/consumer.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index 9edccfb..6381572 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.
OpenPOWER on IntegriCloud