Lines Matching defs:buffer
17 #include <linux/iio/buffer.h>
19 #include <linux/iio/buffer-dma.h>
20 #include <linux/iio/buffer-dmaengine.h>
23 * The IIO DMAengine buffer combines the generic IIO DMA buffer infrastructure
24 * with the DMAengine framework. The generic IIO DMA buffer infrastructure is
25 * used to manage the buffer memory and implement the IIO buffer operations
27 * this results in a device independent fully functional DMA buffer
43 struct iio_buffer *buffer)
45 return container_of(buffer, struct dmaengine_buffer, queue.buffer);
65 iio_buffer_to_dmaengine_buffer(&queue->buffer);
98 iio_buffer_to_dmaengine_buffer(&queue->buffer);
135 struct iio_buffer *buffer = to_iio_dev_attr(attr)->buffer;
137 iio_buffer_to_dmaengine_buffer(buffer);
151 * iio_dmaengine_buffer_alloc() - Allocate new buffer which uses DMAengine
152 * @dev: Parent device for the buffer
155 * This allocates a new IIO buffer which internally uses the DMAengine framework
159 * Once done using the buffer iio_dmaengine_buffer_free() should be used to
204 dmaengine_buffer->queue.buffer.attrs = iio_dmaengine_buffer_attrs;
205 dmaengine_buffer->queue.buffer.access = &iio_dmaengine_buffer_ops;
207 return &dmaengine_buffer->queue.buffer;
215 * iio_dmaengine_buffer_free() - Free dmaengine buffer
216 * @buffer: Buffer to free
218 * Frees a buffer previously allocated with iio_dmaengine_buffer_alloc().
220 static void iio_dmaengine_buffer_free(struct iio_buffer *buffer)
223 iio_buffer_to_dmaengine_buffer(buffer);
228 iio_buffer_put(buffer);
231 static void __devm_iio_dmaengine_buffer_free(void *buffer)
233 iio_dmaengine_buffer_free(buffer);
238 * @dev: Parent device for the buffer
241 * This allocates a new IIO buffer which internally uses the DMAengine framework
245 * The buffer will be automatically de-allocated once the device gets destroyed.
250 struct iio_buffer *buffer;
253 buffer = iio_dmaengine_buffer_alloc(dev, channel);
254 if (IS_ERR(buffer))
255 return buffer;
258 buffer);
262 return buffer;
266 * devm_iio_dmaengine_buffer_setup() - Setup a DMA buffer for an IIO device
267 * @dev: Parent device for the buffer
268 * @indio_dev: IIO device to which to attach this buffer.
271 * This allocates a new IIO buffer with devm_iio_dmaengine_buffer_alloc()
280 struct iio_buffer *buffer;
282 buffer = devm_iio_dmaengine_buffer_alloc(indio_dev->dev.parent,
284 if (IS_ERR(buffer))
285 return PTR_ERR(buffer);
289 return iio_device_attach_buffer(indio_dev, buffer);
294 MODULE_DESCRIPTION("DMA buffer for the IIO framework");