aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/iio/consumer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/iio/consumer.h')
-rw-r--r--include/linux/iio/consumer.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index 651f9a0e2765..26fb8f6342bb 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -151,6 +151,16 @@ int iio_read_channel_average_raw(struct iio_channel *chan, int *val);
151int iio_read_channel_processed(struct iio_channel *chan, int *val); 151int iio_read_channel_processed(struct iio_channel *chan, int *val);
152 152
153/** 153/**
154 * iio_write_channel_raw() - write to a given channel
155 * @chan: The channel being queried.
156 * @val: Value being written.
157 *
158 * Note raw writes to iio channels are in dac counts and hence
159 * scale will need to be applied if standard units required.
160 */
161int iio_write_channel_raw(struct iio_channel *chan, int val);
162
163/**
154 * iio_get_channel_type() - get the type of a channel 164 * iio_get_channel_type() - get the type of a channel
155 * @channel: The channel being queried. 165 * @channel: The channel being queried.
156 * @type: The type of the channel. 166 * @type: The type of the channel.
@@ -191,7 +201,7 @@ int iio_read_channel_scale(struct iio_channel *chan, int *val,
191 * The scale factor allows to increase the precession of the returned value. For 201 * The scale factor allows to increase the precession of the returned value. For
192 * a scale factor of 1 the function will return the result in the normal IIO 202 * a scale factor of 1 the function will return the result in the normal IIO
193 * unit for the channel type. E.g. millivolt for voltage channels, if you want 203 * unit for the channel type. E.g. millivolt for voltage channels, if you want
194 * nanovolts instead pass 1000 as the scale factor. 204 * nanovolts instead pass 1000000 as the scale factor.
195 */ 205 */
196int iio_convert_raw_to_processed(struct iio_channel *chan, int raw, 206int iio_convert_raw_to_processed(struct iio_channel *chan, int raw,
197 int *processed, unsigned int scale); 207 int *processed, unsigned int scale);