forked from mirrors/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>
This commit is contained in:
		
							parent
							
								
									c58db2abb1
								
							
						
					
					
						commit
						b470e10eb4
					
				
					 2 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -993,11 +993,15 @@ static int __spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ctlr->dma_tx)
 | 
						if (ctlr->dma_tx)
 | 
				
			||||||
		tx_dev = ctlr->dma_tx->device->dev;
 | 
							tx_dev = ctlr->dma_tx->device->dev;
 | 
				
			||||||
 | 
						else if (ctlr->dma_map_dev)
 | 
				
			||||||
 | 
							tx_dev = ctlr->dma_map_dev;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		tx_dev = ctlr->dev.parent;
 | 
							tx_dev = ctlr->dev.parent;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ctlr->dma_rx)
 | 
						if (ctlr->dma_rx)
 | 
				
			||||||
		rx_dev = ctlr->dma_rx->device->dev;
 | 
							rx_dev = ctlr->dma_rx->device->dev;
 | 
				
			||||||
 | 
						else if (ctlr->dma_map_dev)
 | 
				
			||||||
 | 
							rx_dev = ctlr->dma_map_dev;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		rx_dev = ctlr->dev.parent;
 | 
							rx_dev = ctlr->dev.parent;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -588,6 +588,7 @@ struct spi_controller {
 | 
				
			||||||
	bool			(*can_dma)(struct spi_controller *ctlr,
 | 
						bool			(*can_dma)(struct spi_controller *ctlr,
 | 
				
			||||||
					   struct spi_device *spi,
 | 
										   struct spi_device *spi,
 | 
				
			||||||
					   struct spi_transfer *xfer);
 | 
										   struct spi_transfer *xfer);
 | 
				
			||||||
 | 
						struct device *dma_map_dev;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * These hooks are for drivers that want to use the generic
 | 
						 * These hooks are for drivers that want to use the generic
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue