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
993 993
994 if (ctlr->dma_tx)994 if (ctlr->dma_tx)
995 tx_dev = ctlr->dma_tx->device->dev;995 tx_dev = ctlr->dma_tx->device->dev;
996 else if (ctlr->dma_map_dev)
997 tx_dev = ctlr->dma_map_dev;
996 else998 else
997 tx_dev = ctlr->dev.parent;999 tx_dev = ctlr->dev.parent;
998 1000
999 if (ctlr->dma_rx)1001 if (ctlr->dma_rx)
1000 rx_dev = ctlr->dma_rx->device->dev;1002 rx_dev = ctlr->dma_rx->device->dev;
1003 else if (ctlr->dma_map_dev)
1004 rx_dev = ctlr->dma_map_dev;
1001 else1005 else
1002 rx_dev = ctlr->dev.parent;1006 rx_dev = ctlr->dev.parent;
1003 1007
include/linux/spi/spi.h+1−0
@@ -588,6 +588,7 @@ struct spi_controller { · 587 unmodified lines
588 bool (*can_dma)(struct spi_controller *ctlr,588 bool (*can_dma)(struct spi_controller *ctlr,
589 struct spi_device *spi,589 struct spi_device *spi,
590 struct spi_transfer *xfer);590 struct spi_transfer *xfer);
591 struct device *dma_map_dev;
591 592
592 /*593 /*
593 * These hooks are for drivers that want to use the generic594 * 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