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.
Unified · Split
| @@ -239,13 +239,15 @@ int pxa2xx_spi_set_dma_burst_and_threshold(struct chip_data *chip, · 238 unmodified lines | ||
| 239 | 239 | u32 *threshold) |
| 240 | 240 | { |
| 241 | 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 | 246 | * If the DMA burst size is given in chip_info we use that, |
| 245 | 247 | * otherwise we use the default. Also we use the default FIFO |
| 246 | 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 | 251 | *threshold = SSCR1_RxTresh(RX_THRESH_DFLT) |
| 250 | 252 | | SSCR1_TxTresh(TX_THRESH_DFLT); |
| 251 | 253 | |
| @@ -34,6 +34,8 @@ struct pxa_spi_info { · 33 unmodified lines | ||
| 34 | 34 | void *tx_param; |
| 35 | 35 | void *rx_param; |
| 36 | 36 | |
| 37 | + int dma_burst_size; | |
| 38 | + | |
| 37 | 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 | 134 | rx->dma_dev = &dma_dev->dev; |
| 133 | 135 | |
| 134 | 136 | c->dma_filter = lpss_dma_filter; |
| 137 | + c->dma_burst_size = 8; | |
| 135 | 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 | 225 | spi_pdata.tx_param = c->tx_param; |
| 223 | 226 | spi_pdata.rx_param = c->rx_param; |
| 224 | 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 | 230 | ssp = &spi_pdata.ssp; |
| 227 | 231 | ssp->phys_base = pci_resource_start(dev, 0); |
| @@ -1564,6 +1564,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) · 1563 unmodified lines | ||
| 1564 | 1564 | pdata->is_slave = of_property_read_bool(pdev->dev.of_node, "spi-slave"); |
| 1565 | 1565 | pdata->num_chipselect = 1; |
| 1566 | 1566 | pdata->enable_dma = true; |
| 1567 | + pdata->dma_burst_size = 1; | |
| 1567 | 1568 | |
| 1568 | 1569 | return pdata; |
| 1569 | 1570 | } |
| @@ -25,6 +25,7 @@ struct dma_chan; · 24 unmodified lines | ||
| 25 | 25 | struct pxa2xx_spi_controller { |
| 26 | 26 | u16 num_chipselect; |
| 27 | 27 | u8 enable_dma; |
| 28 | + u8 dma_burst_size; | |
| 28 | 29 | bool is_slave; |
| 29 | 30 | |
| 30 | 31 | /* DMA engine specific config */ |