summaryrefslogtreecommitdiff
path: root/drivers/iio/buffer/industrialio-buffer-dma.c
diff options
context:
space:
mode:
authorNuno Sá <nuno.sa@analog.com>2025-10-07 10:15:22 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2025-10-13 08:38:08 +0100
commitf9c198c3ccaf90a1a265fb2ffa8d4b093c3b0784 (patch)
tree6a89d14d0c10ad8b66edd92b63efd0b1b83d918b /drivers/iio/buffer/industrialio-buffer-dma.c
parenta514bb109eada64f798f1c86c17182229cc20fe7 (diff)
iio: buffer-dma: support getting the DMA channel
Implement the .get_dma_dev() callback for DMA buffers by returning the device that owns the DMA channel. This allows the core DMABUF infrastructure to properly map DMA buffers using the correct device, avoiding the need for bounce buffers on systems where memory is mapped above the 32-bit range. The function returns the DMA queue's device, which is the actual device responsible for DMA operations in buffer-dma implementations. Cc: stable@vger.kernel.org Reviewed-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/buffer/industrialio-buffer-dma.c')
-rw-r--r--drivers/iio/buffer/industrialio-buffer-dma.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iio/buffer/industrialio-buffer-dma.c b/drivers/iio/buffer/industrialio-buffer-dma.c
index ee294a775e8a..7a7a9d37339b 100644
--- a/drivers/iio/buffer/industrialio-buffer-dma.c
+++ b/drivers/iio/buffer/industrialio-buffer-dma.c
@@ -786,6 +786,12 @@ out_end_signalling:
}
EXPORT_SYMBOL_NS_GPL(iio_dma_buffer_enqueue_dmabuf, "IIO_DMA_BUFFER");
+struct device *iio_dma_buffer_get_dma_dev(struct iio_buffer *buffer)
+{
+ return iio_buffer_to_queue(buffer)->dev;
+}
+EXPORT_SYMBOL_NS_GPL(iio_dma_buffer_get_dma_dev, "IIO_DMA_BUFFER");
+
void iio_dma_buffer_lock_queue(struct iio_buffer *buffer)
{
struct iio_dma_buffer_queue *queue = iio_buffer_to_queue(buffer);