diff options
author | Matt Ranostay <mranostay@gmail.com> | 2016-08-19 23:17:02 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-08-21 06:47:19 -0400 |
commit | adca058b56108eb3458165c6a9e5d78558be8b52 (patch) | |
tree | 979cca3ed01fb1ea688b170d34e0d7bfdc5d30a4 /include/linux/iio | |
parent | a4fa6509dda47e51c3582409e8630b24702970c5 (diff) |
iio: buffer-callback: allow getting underlying iio_dev
Add iio_channel_cb_get_iio_dev function to allow getting the
underlying iio_dev. This is useful for setting the trigger of the
consumer ADC device.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include/linux/iio')
-rw-r--r-- | include/linux/iio/consumer.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index 3d672f72e7ec..9edccfba1ffb 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h | |||
@@ -165,6 +165,18 @@ struct iio_channel | |||
165 | *iio_channel_cb_get_channels(const struct iio_cb_buffer *cb_buffer); | 165 | *iio_channel_cb_get_channels(const struct iio_cb_buffer *cb_buffer); |
166 | 166 | ||
167 | /** | 167 | /** |
168 | * iio_channel_cb_get_iio_dev() - get access to the underlying device. | ||
169 | * @cb_buffer: The callback buffer from whom we want the device | ||
170 | * information. | ||
171 | * | ||
172 | * This function allows one to obtain information about the device. | ||
173 | * The primary aim is to allow drivers that are consuming a device to query | ||
174 | * things like current trigger. | ||
175 | */ | ||
176 | struct iio_dev | ||
177 | *iio_channel_cb_get_iio_dev(const struct iio_cb_buffer *cb_buffer); | ||
178 | |||
179 | /** | ||
168 | * iio_read_channel_raw() - read from a given channel | 180 | * iio_read_channel_raw() - read from a given channel |
169 | * @chan: The channel being queried. | 181 | * @chan: The channel being queried. |
170 | * @val: Value read back. | 182 | * @val: Value read back. |