summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-05-29 20:31:49 +0200
committerMark Brown <broonie@kernel.org>2020-05-29 21:04:04 +0200
commitb3f82dc26c0d4e1348ef81e0189cb8838b8b0d22 (patch)
treef03cafaf2722be55a49abb9ba2d29fc663ab9f94 /drivers/spi
parentspi: bcm2835: Remove shared interrupt support (diff)
downloadlinux-b3f82dc26c0d4e1348ef81e0189cb8838b8b0d22.tar.xz
linux-b3f82dc26c0d4e1348ef81e0189cb8838b8b0d22.zip
spi: dw: Make DMA request line assignments explicit for Intel Medfield
The 2afccbd283ae ("spi: dw: Discard static DW DMA slave structures") did a clean up of global variables, which is fine, but messed up with the carefully provided information in the custom DMA slave structures. There reader can find an assignment of the DMA request lines in use. Partially revert the above mentioned commit to restore readability and maintainability of the code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200529183150.44149-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-dw-dma.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c
index 1b96cec6d8cd..53d5257662e8 100644
--- a/drivers/spi/spi-dw-dma.c
+++ b/drivers/spi/spi-dw-dma.c
@@ -61,10 +61,8 @@ static void dw_spi_dma_maxburst_init(struct dw_spi *dws)
static int dw_spi_dma_init_mfld(struct device *dev, struct dw_spi *dws)
{
- struct dw_dma_slave slave = {
- .src_id = 0,
- .dst_id = 0
- };
+ struct dw_dma_slave dma_tx = { .dst_id = 1 }, *tx = &dma_tx;
+ struct dw_dma_slave dma_rx = { .src_id = 0 }, *rx = &dma_rx;
struct pci_dev *dma_dev;
dma_cap_mask_t mask;
@@ -80,14 +78,14 @@ static int dw_spi_dma_init_mfld(struct device *dev, struct dw_spi *dws)
dma_cap_set(DMA_SLAVE, mask);
/* 1. Init rx channel */
- slave.dma_dev = &dma_dev->dev;
- dws->rxchan = dma_request_channel(mask, dw_spi_dma_chan_filter, &slave);
+ rx->dma_dev = &dma_dev->dev;
+ dws->rxchan = dma_request_channel(mask, dw_spi_dma_chan_filter, rx);
if (!dws->rxchan)
goto err_exit;
/* 2. Init tx channel */
- slave.dst_id = 1;
- dws->txchan = dma_request_channel(mask, dw_spi_dma_chan_filter, &slave);
+ tx->dma_dev = &dma_dev->dev;
+ dws->txchan = dma_request_channel(mask, dw_spi_dma_chan_filter, tx);
if (!dws->txchan)
goto free_rxchan;