Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: core: add dma_map_dev for dma device

Some controllers like qcom geni need the parent device to be used for
dma mapping, so add a dma_map_dev field and let drivers fill this to be
used as mapping device

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20210625052213.32260-4-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Vinod Koul and committed by
Mark Brown
b470e10e c58db2ab

+5
+4
drivers/spi/spi.c
··· 993 993 994 994 if (ctlr->dma_tx) 995 995 tx_dev = ctlr->dma_tx->device->dev; 996 + else if (ctlr->dma_map_dev) 997 + tx_dev = ctlr->dma_map_dev; 996 998 else 997 999 tx_dev = ctlr->dev.parent; 998 1000 999 1001 if (ctlr->dma_rx) 1000 1002 rx_dev = ctlr->dma_rx->device->dev; 1003 + else if (ctlr->dma_map_dev) 1004 + rx_dev = ctlr->dma_map_dev; 1001 1005 else 1002 1006 rx_dev = ctlr->dev.parent; 1003 1007
+1
include/linux/spi/spi.h
··· 588 588 bool (*can_dma)(struct spi_controller *ctlr, 589 589 struct spi_device *spi, 590 590 struct spi_transfer *xfer); 591 + struct device *dma_map_dev; 591 592 592 593 /* 593 594 * These hooks are for drivers that want to use the generic