Commit 6370abab authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

spi: dw: Propagate struct device pointer to ->dma_init() callback

In some cases, one of which is coming soon, we would like to have
a struct device pointer to request DMA channel. For this purpose
propagate it to ->dma_init() callback in DMA ops.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200506153025.21441-7-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 37aa8aa6
...@@ -34,7 +34,7 @@ static bool mid_spi_dma_chan_filter(struct dma_chan *chan, void *param) ...@@ -34,7 +34,7 @@ static bool mid_spi_dma_chan_filter(struct dma_chan *chan, void *param)
return true; return true;
} }
static int mid_spi_dma_init_mfld(struct dw_spi *dws) static int mid_spi_dma_init_mfld(struct device *dev, struct dw_spi *dws)
{ {
struct pci_dev *dma_dev; struct pci_dev *dma_dev;
struct dw_dma_slave *tx = dws->dma_tx; struct dw_dma_slave *tx = dws->dma_tx;
......
...@@ -506,7 +506,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) ...@@ -506,7 +506,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
spi_hw_init(dev, dws); spi_hw_init(dev, dws);
if (dws->dma_ops && dws->dma_ops->dma_init) { if (dws->dma_ops && dws->dma_ops->dma_init) {
ret = dws->dma_ops->dma_init(dws); ret = dws->dma_ops->dma_init(dev, dws);
if (ret) { if (ret) {
dev_warn(dev, "DMA init failed\n"); dev_warn(dev, "DMA init failed\n");
dws->dma_inited = 0; dws->dma_inited = 0;
......
...@@ -100,7 +100,7 @@ enum dw_ssi_type { ...@@ -100,7 +100,7 @@ enum dw_ssi_type {
struct dw_spi; struct dw_spi;
struct dw_spi_dma_ops { struct dw_spi_dma_ops {
int (*dma_init)(struct dw_spi *dws); int (*dma_init)(struct device *dev, struct dw_spi *dws);
void (*dma_exit)(struct dw_spi *dws); void (*dma_exit)(struct dw_spi *dws);
int (*dma_setup)(struct dw_spi *dws, struct spi_transfer *xfer); int (*dma_setup)(struct dw_spi *dws, struct spi_transfer *xfer);
bool (*can_dma)(struct spi_controller *master, struct spi_device *spi, bool (*can_dma)(struct spi_controller *master, struct spi_device *spi,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment