History

spi: pxa2xx: Introduce DMA burst size support

Some masters may have different DMA burst size than hard coded default. In such case respect the value given by DMA burst size provided via platform data.

Andy Shevchenko committed 7 years ago

Commit 37821a81 parent 560ee7e4 files · +9 −1Browse files

Unified · Split

4 files
  1. drivers/spi/spi-pxa2xx-dma.c +3 −1
  2. drivers/spi/spi-pxa2xx-pci.c +4 −0
  3. drivers/spi/spi-pxa2xx.c +1 −0
  4. include/linux/spi/pxa2xx_spi.h +1 −0
drivers/spi/spi-pxa2xx-dma.c+3−1
@@ -239,13 +239,15 @@ int pxa2xx_spi_set_dma_burst_and_threshold(struct chip_data *chip, · 238 unmodified lines
239 u32 *threshold)239 u32 *threshold)
240{240{
241 struct pxa2xx_spi_chip *chip_info = spi->controller_data;241 struct pxa2xx_spi_chip *chip_info = spi->controller_data;
242 struct driver_data *drv_data = spi_controller_get_devdata(spi->controller);
243 u32 dma_burst_size = drv_data->controller_info->dma_burst_size;
242 244
243 /*245 /*
244 * If the DMA burst size is given in chip_info we use that,246 * If the DMA burst size is given in chip_info we use that,
245 * otherwise we use the default. Also we use the default FIFO247 * otherwise we use the default. Also we use the default FIFO
246 * thresholds for now.248 * thresholds for now.
247 */249 */
248 *burst_code = chip_info ? chip_info->dma_burst_size : 1;250 *burst_code = chip_info ? chip_info->dma_burst_size : dma_burst_size;
249 *threshold = SSCR1_RxTresh(RX_THRESH_DFLT)251 *threshold = SSCR1_RxTresh(RX_THRESH_DFLT)
250 | SSCR1_TxTresh(TX_THRESH_DFLT);252 | SSCR1_TxTresh(TX_THRESH_DFLT);
251 253
drivers/spi/spi-pxa2xx-pci.c+4−0
@@ -34,6 +34,8 @@ struct pxa_spi_info { · 33 unmodified lines
34 void *tx_param;34 void *tx_param;
35 void *rx_param;35 void *rx_param;
36 36
37 int dma_burst_size;
38
37 int (*setup)(struct pci_dev *pdev, struct pxa_spi_info *c);39 int (*setup)(struct pci_dev *pdev, struct pxa_spi_info *c);
38};40};
39 41
@@ -132,6 +134,7 @@ static int mrfld_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) · 92 unmodified lines
132 rx->dma_dev = &dma_dev->dev;134 rx->dma_dev = &dma_dev->dev;
133 135
134 c->dma_filter = lpss_dma_filter;136 c->dma_filter = lpss_dma_filter;
137 c->dma_burst_size = 8;
135 return 0;138 return 0;
136}139}
137 140
@@ -222,6 +225,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev, · 84 unmodified lines
222 spi_pdata.tx_param = c->tx_param;225 spi_pdata.tx_param = c->tx_param;
223 spi_pdata.rx_param = c->rx_param;226 spi_pdata.rx_param = c->rx_param;
224 spi_pdata.enable_dma = c->rx_param && c->tx_param;227 spi_pdata.enable_dma = c->rx_param && c->tx_param;
228 spi_pdata.dma_burst_size = c->dma_burst_size ? c->dma_burst_size : 1;
225 229
226 ssp = &spi_pdata.ssp;230 ssp = &spi_pdata.ssp;
227 ssp->phys_base = pci_resource_start(dev, 0);231 ssp->phys_base = pci_resource_start(dev, 0);
drivers/spi/spi-pxa2xx.c+1−0
@@ -1564,6 +1564,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) · 1563 unmodified lines
1564 pdata->is_slave = of_property_read_bool(pdev->dev.of_node, "spi-slave");1564 pdata->is_slave = of_property_read_bool(pdev->dev.of_node, "spi-slave");
1565 pdata->num_chipselect = 1;1565 pdata->num_chipselect = 1;
1566 pdata->enable_dma = true;1566 pdata->enable_dma = true;
1567 pdata->dma_burst_size = 1;
1567 1568
1568 return pdata;1569 return pdata;
1569}1570}
include/linux/spi/pxa2xx_spi.h+1−0
@@ -25,6 +25,7 @@ struct dma_chan; · 24 unmodified lines
25struct pxa2xx_spi_controller {25struct pxa2xx_spi_controller {
26 u16 num_chipselect;26 u16 num_chipselect;
27 u8 enable_dma;27 u8 enable_dma;
28 u8 dma_burst_size;
28 bool is_slave;29 bool is_slave;
29 30
30 /* DMA engine specific config */31 /* DMA engine specific config */

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