]> Gentwo Git Trees - linux/.git/commit
iio: buffer: support getting dma channel from the buffer
authorNuno Sá <nuno.sa@analog.com>
Tue, 7 Oct 2025 09:15:21 +0000 (10:15 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 13 Oct 2025 07:38:08 +0000 (08:38 +0100)
commita514bb109eada64f798f1c86c17182229cc20fe7
tree90700953b18261881ce530afffd451cbf411f15e
parent0bf1bfde53b30da7fd7f4a6c3db5b8e77888958d
iio: buffer: support getting dma channel from the buffer

Add a new buffer accessor .get_dma_dev() in order to get the
struct device responsible for actually providing the dma channel. We
cannot assume that we can use the parent of the IIO device for mapping
the DMA buffer. This becomes important on systems (like the Xilinx/AMD
zynqMP Ultrascale) where memory (or part of it) is mapped above the
32 bit range. On such systems and given that a device by default has
a dma mask of 32 bits we would then need to rely on bounce buffers (to
swiotlb) for mapping memory above the dma mask limit.

In the process, add an iio_buffer_get_dma_dev() helper function to get
the proper DMA device.

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>
drivers/iio/industrialio-buffer.c
include/linux/iio/buffer_impl.h