Lines Matching refs:dmaengine_buffer
32 struct dmaengine_buffer { struct
42 static struct dmaengine_buffer *iio_buffer_to_dmaengine_buffer( in iio_buffer_to_dmaengine_buffer() argument
45 return container_of(buffer, struct dmaengine_buffer, queue.buffer); in iio_buffer_to_dmaengine_buffer()
64 struct dmaengine_buffer *dmaengine_buffer = in iio_dmaengine_buffer_submit_block() local
69 block->bytes_used = min(block->size, dmaengine_buffer->max_size); in iio_dmaengine_buffer_submit_block()
71 dmaengine_buffer->align); in iio_dmaengine_buffer_submit_block()
73 desc = dmaengine_prep_slave_single(dmaengine_buffer->chan, in iio_dmaengine_buffer_submit_block()
86 spin_lock_irq(&dmaengine_buffer->queue.list_lock); in iio_dmaengine_buffer_submit_block()
87 list_add_tail(&block->head, &dmaengine_buffer->active); in iio_dmaengine_buffer_submit_block()
88 spin_unlock_irq(&dmaengine_buffer->queue.list_lock); in iio_dmaengine_buffer_submit_block()
90 dma_async_issue_pending(dmaengine_buffer->chan); in iio_dmaengine_buffer_submit_block()
97 struct dmaengine_buffer *dmaengine_buffer = in iio_dmaengine_buffer_abort() local
100 dmaengine_terminate_sync(dmaengine_buffer->chan); in iio_dmaengine_buffer_abort()
101 iio_dma_buffer_block_list_abort(queue, &dmaengine_buffer->active); in iio_dmaengine_buffer_abort()
106 struct dmaengine_buffer *dmaengine_buffer = in iio_dmaengine_buffer_release() local
109 iio_dma_buffer_release(&dmaengine_buffer->queue); in iio_dmaengine_buffer_release()
110 kfree(dmaengine_buffer); in iio_dmaengine_buffer_release()
136 struct dmaengine_buffer *dmaengine_buffer = in iio_dmaengine_buffer_get_length_align() local
139 return sysfs_emit(buf, "%zu\n", dmaengine_buffer->align); in iio_dmaengine_buffer_get_length_align()
165 struct dmaengine_buffer *dmaengine_buffer; in iio_dmaengine_buffer_alloc() local
171 dmaengine_buffer = kzalloc(sizeof(*dmaengine_buffer), GFP_KERNEL); in iio_dmaengine_buffer_alloc()
172 if (!dmaengine_buffer) in iio_dmaengine_buffer_alloc()
196 INIT_LIST_HEAD(&dmaengine_buffer->active); in iio_dmaengine_buffer_alloc()
197 dmaengine_buffer->chan = chan; in iio_dmaengine_buffer_alloc()
198 dmaengine_buffer->align = width; in iio_dmaengine_buffer_alloc()
199 dmaengine_buffer->max_size = dma_get_max_seg_size(chan->device->dev); in iio_dmaengine_buffer_alloc()
201 iio_dma_buffer_init(&dmaengine_buffer->queue, chan->device->dev, in iio_dmaengine_buffer_alloc()
204 dmaengine_buffer->queue.buffer.attrs = iio_dmaengine_buffer_attrs; in iio_dmaengine_buffer_alloc()
205 dmaengine_buffer->queue.buffer.access = &iio_dmaengine_buffer_ops; in iio_dmaengine_buffer_alloc()
207 return &dmaengine_buffer->queue.buffer; in iio_dmaengine_buffer_alloc()
210 kfree(dmaengine_buffer); in iio_dmaengine_buffer_alloc()
223 struct dmaengine_buffer *dmaengine_buffer = in iio_dmaengine_buffer_free() local
226 iio_dma_buffer_exit(&dmaengine_buffer->queue); in iio_dmaengine_buffer_free()
227 dma_release_channel(dmaengine_buffer->chan); in iio_dmaengine_buffer_free()