aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-01-02 06:47:31 -0500
committerMark Brown <broonie@kernel.org>2017-01-04 13:36:41 -0500
commit25014521603f70225c1e6fa232839614f7b4f692 (patch)
treedf2b6b9ebaf90dc668ac103ec8f24c66497da216
parent63971c5682bf89e15083733dcd7b4610e789e843 (diff)
spi: pxa2xx-pci: Enable DMA for Intel Merrifield
SPI controller on Intel Merrifield is backed by DMA engine. Add necessary bits to support it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-pxa2xx-pci.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 58d2d48e16a5..868452d8e3e1 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -41,6 +41,13 @@ struct pxa_spi_info {
41static struct dw_dma_slave byt_tx_param = { .dst_id = 0 }; 41static struct dw_dma_slave byt_tx_param = { .dst_id = 0 };
42static struct dw_dma_slave byt_rx_param = { .src_id = 1 }; 42static struct dw_dma_slave byt_rx_param = { .src_id = 1 };
43 43
44static struct dw_dma_slave mrfld3_tx_param = { .dst_id = 15 };
45static struct dw_dma_slave mrfld3_rx_param = { .src_id = 14 };
46static struct dw_dma_slave mrfld5_tx_param = { .dst_id = 13 };
47static struct dw_dma_slave mrfld5_rx_param = { .src_id = 12 };
48static struct dw_dma_slave mrfld6_tx_param = { .dst_id = 11 };
49static struct dw_dma_slave mrfld6_rx_param = { .src_id = 10 };
50
44static struct dw_dma_slave bsw0_tx_param = { .dst_id = 0 }; 51static struct dw_dma_slave bsw0_tx_param = { .dst_id = 0 };
45static struct dw_dma_slave bsw0_rx_param = { .src_id = 1 }; 52static struct dw_dma_slave bsw0_rx_param = { .src_id = 1 };
46static struct dw_dma_slave bsw1_tx_param = { .dst_id = 6 }; 53static struct dw_dma_slave bsw1_tx_param = { .dst_id = 6 };
@@ -93,22 +100,39 @@ static int lpss_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
93 100
94static int mrfld_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) 101static int mrfld_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
95{ 102{
103 struct pci_dev *dma_dev = pci_get_slot(dev->bus, PCI_DEVFN(21, 0));
104 struct dw_dma_slave *tx, *rx;
105
96 switch (PCI_FUNC(dev->devfn)) { 106 switch (PCI_FUNC(dev->devfn)) {
97 case 0: 107 case 0:
98 c->port_id = 3; 108 c->port_id = 3;
99 c->num_chipselect = 1; 109 c->num_chipselect = 1;
110 c->tx_param = &mrfld3_tx_param;
111 c->rx_param = &mrfld3_rx_param;
100 break; 112 break;
101 case 1: 113 case 1:
102 c->port_id = 5; 114 c->port_id = 5;
103 c->num_chipselect = 4; 115 c->num_chipselect = 4;
116 c->tx_param = &mrfld5_tx_param;
117 c->rx_param = &mrfld5_rx_param;
104 break; 118 break;
105 case 2: 119 case 2:
106 c->port_id = 6; 120 c->port_id = 6;
107 c->num_chipselect = 1; 121 c->num_chipselect = 1;
122 c->tx_param = &mrfld6_tx_param;
123 c->rx_param = &mrfld6_rx_param;
108 break; 124 break;
109 default: 125 default:
110 return -ENODEV; 126 return -ENODEV;
111 } 127 }
128
129 tx = c->tx_param;
130 tx->dma_dev = &dma_dev->dev;
131
132 rx = c->rx_param;
133 rx->dma_dev = &dma_dev->dev;
134
135 c->dma_filter = lpss_dma_filter;
112 return 0; 136 return 0;
113} 137}
114 138