aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@kernel.org>2012-06-30 15:06:00 -0400
committerJonathan Cameron <jic23@kernel.org>2012-11-10 05:17:27 -0500
commit92d1079b281f89f1c65c6aece3cfab4fb422c797 (patch)
treee593bbfae9a9fdaa9a1cc8500f99fb1064f2050c /include/linux
parent0464415dd21785aa8e8b12dbc939fcb5ca52f464 (diff)
staging:iio: add a callback buffer for in kernel push interface
This callback buffer is meant to be opaque to users, but basically adds a very simple pass through buffer to which data may be pushed when it is inserted into the buffer list. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/iio/consumer.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index 57efee63a6da..126c0a9375f2 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -61,6 +61,52 @@ struct iio_channel *iio_channel_get_all(const char *name);
61 */ 61 */
62void iio_channel_release_all(struct iio_channel *chan); 62void iio_channel_release_all(struct iio_channel *chan);
63 63
64struct iio_cb_buffer;
65/**
66 * iio_channel_get_all_cb() - register callback for triggered capture
67 * @name: Name of client device.
68 * @cb: Callback function.
69 * @private: Private data passed to callback.
70 *
71 * NB right now we have no ability to mux data from multiple devices.
72 * So if the channels requested come from different devices this will
73 * fail.
74 */
75struct iio_cb_buffer *iio_channel_get_all_cb(const char *name,
76 int (*cb)(u8 *data,
77 void *private),
78 void *private);
79/**
80 * iio_channel_release_all_cb() - release and unregister the callback.
81 * @cb_buffer: The callback buffer that was allocated.
82 */
83void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buffer);
84
85/**
86 * iio_channel_start_all_cb() - start the flow of data through callback.
87 * @cb_buff: The callback buffer we are starting.
88 */
89int iio_channel_start_all_cb(struct iio_cb_buffer *cb_buff);
90
91/**
92 * iio_channel_stop_all_cb() - stop the flow of data through the callback.
93 * @cb_buff: The callback buffer we are stopping.
94 */
95void iio_channel_stop_all_cb(struct iio_cb_buffer *cb_buff);
96
97/**
98 * iio_channel_cb_get_channels() - get access to the underlying channels.
99 * @cb_buff: The callback buffer from whom we want the channel
100 * information.
101 *
102 * This function allows one to obtain information about the channels.
103 * Whilst this may allow direct reading if all buffers are disabled, the
104 * primary aim is to allow drivers that are consuming a channel to query
105 * things like scaling of the channel.
106 */
107struct iio_channel
108*iio_channel_cb_get_channels(const struct iio_cb_buffer *cb_buffer);
109
64/** 110/**
65 * iio_read_channel_raw() - read from a given channel 111 * iio_read_channel_raw() - read from a given channel
66 * @chan: The channel being queried. 112 * @chan: The channel being queried.