summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorNicholas Troast <ntroast@codeaurora.org>2016-12-14 14:26:27 -0800
committerNicholas Troast <ntroast@codeaurora.org>2017-02-03 08:36:59 -0800
commit557ea9fd772640ab4d4657c4e7fabbcc074f470e (patch)
tree206a06e5118af855027a1298d3ea84bbecf7eea1 /include/linux
parentacf15eb7297024a806701cc95e90de6c2ccc398d (diff)
iio: support writing processed values to IIO channels
Add a new function to the IIO API which allows consumers to write processed values to IIO channels. This is particularly useful for supporting hardware which has configurable ADC thresholds. A consumer would be able to change an ADC threshold by providing a processed value instead of calculating a raw value. Change-Id: I7d3b22beddb6fd1fda0cc0aefbcb4cf5cb58bf82 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/iio/consumer.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index fad58671c49e..62acf17a894b 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -161,6 +161,16 @@ int iio_read_channel_processed(struct iio_channel *chan, int *val);
int iio_write_channel_raw(struct iio_channel *chan, int val);
/**
+ * iio_write_channel_processed() - write to a given channel
+ * @chan: The channel being queried.
+ * @val: Value being written.
+ *
+ * Note processed writes to iio channels are converted to raw
+ * values before being written.
+ */
+int iio_write_channel_processed(struct iio_channel *chan, int val);
+
+/**
* iio_get_channel_type() - get the type of a channel
* @channel: The channel being queried.
* @type: The type of the channel.