diff options
author | Matt Ranostay <mranostay@gmail.com> | 2016-08-19 20:17:02 -0700 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-08-21 11:47:19 +0100 |
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 *iio_channel_cb_get_channels(const struct iio_cb_buffer *cb_buffer); /** + * iio_channel_cb_get_iio_dev() - get access to the underlying device. + * @cb_buffer: The callback buffer from whom we want the device + * information. + * + * This function allows one to obtain information about the device. + * The primary aim is to allow drivers that are consuming a device to query + * things like current trigger. + */ +struct iio_dev +*iio_channel_cb_get_iio_dev(const struct iio_cb_buffer *cb_buffer); + +/** * iio_read_channel_raw() - read from a given channel * @chan: The channel being queried. * @val: Value read back. |