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
239239 u32 *threshold)
240240 {
241241 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;
242244
243245 /*
244246 * If the DMA burst size is given in chip_info we use that,
245247 * otherwise we use the default. Also we use the default FIFO
246248 * thresholds for now.
247249 */
248− *burst_code = chip_info ? chip_info->dma_burst_size : 1;
250+ *burst_code = chip_info ? chip_info->dma_burst_size : dma_burst_size;
249251 *threshold = SSCR1_RxTresh(RX_THRESH_DFLT)
250252 | SSCR1_TxTresh(TX_THRESH_DFLT);
251253
drivers/spi/spi-pxa2xx-pci.c+4−0
@@ -34,6 +34,8 @@ struct pxa_spi_info { · 33 unmodified lines
3434 void *tx_param;
3535 void *rx_param;
3636
37+ int dma_burst_size;
38+
3739 int (*setup)(struct pci_dev *pdev, struct pxa_spi_info *c);
3840 };
3941
@@ -132,6 +134,7 @@ static int mrfld_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) · 92 unmodified lines
132134 rx->dma_dev = &dma_dev->dev;
133135
134136 c->dma_filter = lpss_dma_filter;
137+ c->dma_burst_size = 8;
135138 return 0;
136139 }
137140
@@ -222,6 +225,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev, · 84 unmodified lines
222225 spi_pdata.tx_param = c->tx_param;
223226 spi_pdata.rx_param = c->rx_param;
224227 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;
225229
226230 ssp = &spi_pdata.ssp;
227231 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
15641564 pdata->is_slave = of_property_read_bool(pdev->dev.of_node, "spi-slave");
15651565 pdata->num_chipselect = 1;
15661566 pdata->enable_dma = true;
1567+ pdata->dma_burst_size = 1;
15671568
15681569 return pdata;
15691570 }
include/linux/spi/pxa2xx_spi.h+1−0
@@ -25,6 +25,7 @@ struct dma_chan; · 24 unmodified lines
2525 struct pxa2xx_spi_controller {
2626 u16 num_chipselect;
2727 u8 enable_dma;
28+ u8 dma_burst_size;
2829 bool is_slave;
2930
3031 /* 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