diff options
author | Vinod Koul <vkoul@kernel.org> | 2021-06-25 10:52:11 +0530 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-06-25 12:26:49 +0100 |
commit | b470e10eb43f19e08245cd87dd3192a8141cfbb5 (patch) | |
tree | a773f13ce4c5fa815d661534cd3aadf75b7509a3 /drivers | |
parent | c58db2abb19fd2bf23fb25bb3630a9f540df6042 (diff) | |
download | linux-b470e10eb43f19e08245cd87dd3192a8141cfbb5.tar.bz2 |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/spi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index c296f08b36c1..35928d0843d9 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -993,11 +993,15 @@ static int __spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg) if (ctlr->dma_tx) tx_dev = ctlr->dma_tx->device->dev; + else if (ctlr->dma_map_dev) + tx_dev = ctlr->dma_map_dev; else tx_dev = ctlr->dev.parent; if (ctlr->dma_rx) rx_dev = ctlr->dma_rx->device->dev; + else if (ctlr->dma_map_dev) + rx_dev = ctlr->dma_map_dev; else rx_dev = ctlr->dev.parent; |