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>
This commit is contained in:
Matt Ranostay
2016-08-19 20:17:02 -07:00
committed by Jonathan Cameron
parent a4fa6509dd
commit adca058b56
2 changed files with 26 additions and 10 deletions

View File

@@ -164,6 +164,18 @@ void iio_channel_stop_all_cb(struct iio_cb_buffer *cb_buff);
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.