aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2016-11-10 10:17:51 -0500
committerVinod Koul <vinod.koul@intel.com>2016-11-17 05:21:28 -0500
commit6f8dc9d481759b428a8cb6a17b83821451415ba9 (patch)
treea17391c4fe8c602601c0112085510b8e76cb3bbb
parent5d13982a246ce49200c59f65902f047e7633ae65 (diff)
spi: s3c64xx: Do not use platform_data for DMA parameters
All related platforms use either devicetree or the DMA slave map API for mapping DMA channels to DMA slaves so we can now stop using platform_data for passing DMA details. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Tested-by: Andi Shyti <andi.shyti@samsung.com> Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/spi/spi-s3c64xx.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 3c09e94cf827..28dfdce4beae 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -341,27 +341,20 @@ static void s3c64xx_spi_set_cs(struct spi_device *spi, bool enable)
341static int s3c64xx_spi_prepare_transfer(struct spi_master *spi) 341static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
342{ 342{
343 struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi); 343 struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi);
344 dma_filter_fn filter = sdd->cntrlr_info->filter;
345 struct device *dev = &sdd->pdev->dev; 344 struct device *dev = &sdd->pdev->dev;
346 dma_cap_mask_t mask;
347 345
348 if (is_polling(sdd)) 346 if (is_polling(sdd))
349 return 0; 347 return 0;
350 348
351 dma_cap_zero(mask);
352 dma_cap_set(DMA_SLAVE, mask);
353
354 /* Acquire DMA channels */ 349 /* Acquire DMA channels */
355 sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter, 350 sdd->rx_dma.ch = dma_request_slave_channel(dev, "rx");
356 sdd->cntrlr_info->dma_rx, dev, "rx");
357 if (!sdd->rx_dma.ch) { 351 if (!sdd->rx_dma.ch) {
358 dev_err(dev, "Failed to get RX DMA channel\n"); 352 dev_err(dev, "Failed to get RX DMA channel\n");
359 return -EBUSY; 353 return -EBUSY;
360 } 354 }
361 spi->dma_rx = sdd->rx_dma.ch; 355 spi->dma_rx = sdd->rx_dma.ch;
362 356
363 sdd->tx_dma.ch = dma_request_slave_channel_compat(mask, filter, 357 sdd->tx_dma.ch = dma_request_slave_channel(dev, "tx");
364 sdd->cntrlr_info->dma_tx, dev, "tx");
365 if (!sdd->tx_dma.ch) { 358 if (!sdd->tx_dma.ch) {
366 dev_err(dev, "Failed to get TX DMA channel\n"); 359 dev_err(dev, "Failed to get TX DMA channel\n");
367 dma_release_channel(sdd->rx_dma.ch); 360 dma_release_channel(sdd->rx_dma.ch);
@@ -1091,11 +1084,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
1091 1084
1092 sdd->cur_bpw = 8; 1085 sdd->cur_bpw = 8;
1093 1086
1094 if (!sdd->pdev->dev.of_node && (!sci->dma_tx || !sci->dma_rx)) {
1095 dev_warn(&pdev->dev, "Unable to get SPI tx/rx DMA data. Switching to poll mode\n");
1096 sdd->port_conf->quirks = S3C64XX_SPI_QUIRK_POLL;
1097 }
1098
1099 sdd->tx_dma.direction = DMA_MEM_TO_DEV; 1087 sdd->tx_dma.direction = DMA_MEM_TO_DEV;
1100 sdd->rx_dma.direction = DMA_DEV_TO_MEM; 1088 sdd->rx_dma.direction = DMA_DEV_TO_MEM;
1101 1089
@@ -1205,9 +1193,8 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
1205 1193
1206 dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached\n", 1194 dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached\n",
1207 sdd->port_id, master->num_chipselect); 1195 sdd->port_id, master->num_chipselect);
1208 dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\tDMA=[Rx-%p, Tx-%p]\n", 1196 dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\n",
1209 mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1, 1197 mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1);
1210 sci->dma_rx, sci->dma_tx);
1211 1198
1212 pm_runtime_mark_last_busy(&pdev->dev); 1199 pm_runtime_mark_last_busy(&pdev->dev);
1213 pm_runtime_put_autosuspend(&pdev->dev); 1200 pm_runtime_put_autosuspend(&pdev->dev);