Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Andy Shevchenko and committed by
Mark Brown
37821a82 560ee7e9

+9 -1
+3 -1
drivers/spi/spi-pxa2xx-dma.c
··· 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
+4
drivers/spi/spi-pxa2xx-pci.c
··· 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 ··· 134 132 rx->dma_dev = &dma_dev->dev; 135 133 136 134 c->dma_filter = lpss_dma_filter; 135 + c->dma_burst_size = 8; 137 136 return 0; 138 137 } 139 138 ··· 225 222 spi_pdata.tx_param = c->tx_param; 226 223 spi_pdata.rx_param = c->rx_param; 227 224 spi_pdata.enable_dma = c->rx_param && c->tx_param; 225 + spi_pdata.dma_burst_size = c->dma_burst_size ? c->dma_burst_size : 1; 228 226 229 227 ssp = &spi_pdata.ssp; 230 228 ssp->phys_base = pci_resource_start(dev, 0);
+1
drivers/spi/spi-pxa2xx.c
··· 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 }
+1
include/linux/spi/pxa2xx_spi.h
··· 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 */