summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorDavid Lechner <dlechner@baylibre.com>2025-02-07 14:09:05 -0600
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2025-02-10 18:47:29 +0000
commit4fe7fd17fe66a5e243c1de7ff32c29fac7039b8d (patch)
treec6d4718ac752bf56a50eea07e937f9986a80d472 /ipc
parenta570114db8ead2e0d90a63888b8e269878ab502f (diff)
iio: buffer-dmaengine: split requesting DMA channel from allocating buffer
Refactor the IIO dmaengine buffer code to split requesting the DMA channel from allocating the buffer. We want to be able to add a new function where the IIO device driver manages the DMA channel, so these two actions need to be separate. To do this, calling dma_request_chan() is moved from iio_dmaengine_buffer_alloc() to iio_dmaengine_buffer_setup_ext(). A new __iio_dmaengine_buffer_setup_ext() helper function is added to simplify error unwinding and will also be used by a new function in a later patch. iio_dmaengine_buffer_free() now only frees the buffer and does not release the DMA channel. A new iio_dmaengine_buffer_teardown() function is added to unwind everything done in iio_dmaengine_buffer_setup_ext(). This keeps things more symmetrical with obvious pairs alloc/free and setup/teardown. Calling dma_get_slave_caps() in iio_dmaengine_buffer_alloc() is moved so that we can avoid any gotos for error unwinding. Reviewed-by: Nuno Sa <nuno.sa@analog.com> Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250207-dlech-mainline-spi-engine-offload-2-v8-8-e48a489be48c@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions