diff options
author | Sebastian Reichel <sre@debian.org> | 2014-10-03 17:25:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-03-16 18:00:33 +0000 |
commit | 476d4af22cec8a9ebc90137712e5ab7070b7379d (patch) | |
tree | 3da0d92e3e37b9a37e0184d5bf8d10a9e2a7d60c /include/linux/iio/consumer.h | |
parent | c0a6b7ee9498269e4bf9a7e6676f2f45edca2f1a (diff) | |
download | blackbird-op-linux-476d4af22cec8a9ebc90137712e5ab7070b7379d.tar.gz blackbird-op-linux-476d4af22cec8a9ebc90137712e5ab7070b7379d.zip |
iio: inkern: add iio_read_channel_average_raw
Add iio_read_channel_average_raw to support reading
averaged raw values in consumer drivers.
Signed-off-by: Sebastian Reichel <sre@debian.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include/linux/iio/consumer.h')
-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 2752b1fd12be..651f9a0e2765 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h @@ -123,6 +123,19 @@ int iio_read_channel_raw(struct iio_channel *chan, int *val); /** + * iio_read_channel_average_raw() - read from a given channel + * @chan: The channel being queried. + * @val: Value read back. + * + * Note raw reads from iio channels are in adc counts and hence + * scale will need to be applied if standard units required. + * + * In opposit to the normal iio_read_channel_raw this function + * returns the average of multiple reads. + */ +int iio_read_channel_average_raw(struct iio_channel *chan, int *val); + +/** * iio_read_channel_processed() - read processed value from a given channel * @chan: The channel being queried. * @val: Value read back. |