aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/iio/buffer.h
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:21 -0500
commit84b36ce5f79c01f792c623f14e92ed86cdccb42f (patch)
treeaa763089df10007bc42aa02b747e652e0b99003e /include/linux/iio/buffer.h
parent4eb3ccf157639a9d9c7829de94017c46c73d9cc4 (diff)
staging:iio: Add support for multiple buffers
Route all buffer writes through the demux. Addition or removal of a buffer results in tear down and setup of all the buffers for a given device. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Tested-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
Diffstat (limited to 'include/linux/iio/buffer.h')
-rw-r--r--include/linux/iio/buffer.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index c629b3a1d9a9..027040569180 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -66,7 +66,8 @@ struct iio_buffer_access_funcs {
66 * @stufftoread: [INTERN] flag to indicate new data. 66 * @stufftoread: [INTERN] flag to indicate new data.
67 * @demux_list: [INTERN] list of operations required to demux the scan. 67 * @demux_list: [INTERN] list of operations required to demux the scan.
68 * @demux_bounce: [INTERN] buffer for doing gather from incoming scan. 68 * @demux_bounce: [INTERN] buffer for doing gather from incoming scan.
69 **/ 69 * @buffer_list: [INTERN] entry in the devices list of current buffers.
70 */
70struct iio_buffer { 71struct iio_buffer {
71 int length; 72 int length;
72 int bytes_per_datum; 73 int bytes_per_datum;
@@ -81,9 +82,22 @@ struct iio_buffer {
81 const struct attribute_group *attrs; 82 const struct attribute_group *attrs;
82 struct list_head demux_list; 83 struct list_head demux_list;
83 unsigned char *demux_bounce; 84 unsigned char *demux_bounce;
85 struct list_head buffer_list;
84}; 86};
85 87
86/** 88/**
89 * iio_update_buffers() - add or remove buffer from active list
90 * @indio_dev: device to add buffer to
91 * @insert_buffer: buffer to insert
92 * @remove_buffer: buffer_to_remove
93 *
94 * Note this will tear down the all buffering and build it up again
95 */
96int iio_update_buffers(struct iio_dev *indio_dev,
97 struct iio_buffer *insert_buffer,
98 struct iio_buffer *remove_buffer);
99
100/**
87 * iio_buffer_init() - Initialize the buffer structure 101 * iio_buffer_init() - Initialize the buffer structure
88 * @buffer: buffer to be initialized 102 * @buffer: buffer to be initialized
89 **/ 103 **/
@@ -115,11 +129,11 @@ int iio_scan_mask_set(struct iio_dev *indio_dev,
115 struct iio_buffer *buffer, int bit); 129 struct iio_buffer *buffer, int bit);
116 130
117/** 131/**
118 * iio_push_to_buffer() - push to a registered buffer. 132 * iio_push_to_buffers() - push to a registered buffer.
119 * @buffer: IIO buffer structure for device 133 * @indio_dev: iio_dev structure for device.
120 * @data: the data to push to the buffer 134 * @data: Full scan.
121 */ 135 */
122int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data); 136int iio_push_to_buffers(struct iio_dev *indio_dev, unsigned char *data);
123 137
124int iio_update_demux(struct iio_dev *indio_dev); 138int iio_update_demux(struct iio_dev *indio_dev);
125 139