History

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

Vinod Koul committed 5 years ago

Commit b470e101 parent c58db2a2 files · +5 −0Browse files

Unified · Split

2 files
  1. drivers/spi/spi.c +4 −0
  2. include/linux/spi/spi.h +1 −0
drivers/spi/spi.c+4−0
@@ -993,11 +993,15 @@ static int __spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg) · 992 unmodified lines
993993
994994 if (ctlr->dma_tx)
995995 tx_dev = ctlr->dma_tx->device->dev;
996+ else if (ctlr->dma_map_dev)
997+ tx_dev = ctlr->dma_map_dev;
996998 else
997999 tx_dev = ctlr->dev.parent;
9981000
9991001 if (ctlr->dma_rx)
10001002 rx_dev = ctlr->dma_rx->device->dev;
1003+ else if (ctlr->dma_map_dev)
1004+ rx_dev = ctlr->dma_map_dev;
10011005 else
10021006 rx_dev = ctlr->dev.parent;
10031007
include/linux/spi/spi.h+1−0
@@ -588,6 +588,7 @@ struct spi_controller { · 587 unmodified lines
588588 bool (*can_dma)(struct spi_controller *ctlr,
589589 struct spi_device *spi,
590590 struct spi_transfer *xfer);
591+ struct device *dma_map_dev;
591592
592593 /*
593594 * These hooks are for drivers that want to use the generic

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t