aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-pxa2xx.c
diff options
context:
space:
mode:
authorDan O'Donovan <dan@emutex.com>2016-05-27 14:57:48 -0400
committerMark Brown <broonie@kernel.org>2016-05-30 12:09:31 -0400
commitc64e1265ae8516c0282b45e099ac5fbdb8486c4c (patch)
tree6733715dc8ed889c0a39215ccccb76457b316444 /drivers/spi/spi-pxa2xx.c
parent1a695a905c18548062509178b98bc91e67510864 (diff)
spi: pxa2xx: use DMA by default if supported
Currently, even if the PXA2xx SPI master supports DMA, it won't be enabled unless (i) the slave device is enumerated through ACPI, or (ii) the slave device is registered with board-specific controller_data specified. Even then, there isn't a field in the controller_data that explicitly enables dma - it just gets enabled if the master supports it and controller_data is non-NULL. This means that drivers which register SPI devices on a bus without awareness of this controller cannot avail of DMA performance gains. This patch allows DMA transfers to be used if supported. Signed-off-by: Dan O'Donovan <dan@emutex.com> Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pxa2xx.c')
-rw-r--r--drivers/spi/spi-pxa2xx.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index fe07c0592b44..27e03076f379 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1240,7 +1240,7 @@ static int setup(struct spi_device *spi)
1240 chip->frm = spi->chip_select; 1240 chip->frm = spi->chip_select;
1241 } else 1241 } else
1242 chip->gpio_cs = -1; 1242 chip->gpio_cs = -1;
1243 chip->enable_dma = 0; 1243 chip->enable_dma = drv_data->master_info->enable_dma;
1244 chip->timeout = TIMOUT_DFLT; 1244 chip->timeout = TIMOUT_DFLT;
1245 } 1245 }
1246 1246
@@ -1259,17 +1259,9 @@ static int setup(struct spi_device *spi)
1259 tx_hi_thres = chip_info->tx_hi_threshold; 1259 tx_hi_thres = chip_info->tx_hi_threshold;
1260 if (chip_info->rx_threshold) 1260 if (chip_info->rx_threshold)
1261 rx_thres = chip_info->rx_threshold; 1261 rx_thres = chip_info->rx_threshold;
1262 chip->enable_dma = drv_data->master_info->enable_dma;
1263 chip->dma_threshold = 0; 1262 chip->dma_threshold = 0;
1264 if (chip_info->enable_loopback) 1263 if (chip_info->enable_loopback)
1265 chip->cr1 = SSCR1_LBM; 1264 chip->cr1 = SSCR1_LBM;
1266 } else if (ACPI_HANDLE(&spi->dev)) {
1267 /*
1268 * Slave devices enumerated from ACPI namespace don't
1269 * usually have chip_info but we still might want to use
1270 * DMA with them.
1271 */
1272 chip->enable_dma = drv_data->master_info->enable_dma;
1273 } 1265 }
1274 1266
1275 chip->lpss_rx_threshold = SSIRF_RxThresh(rx_thres); 1267 chip->lpss_rx_threshold = SSIRF_RxThresh(rx_thres);