Skip to content

Commit

Permalink
spi: s3c64xx: Do not use platform_data for DMA parameters
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sylwester Nawrocki authored and Vinod Koul committed Nov 17, 2016
1 parent 5d13982 commit 6f8dc9d
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions drivers/spi/spi-s3c64xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,27 +341,20 @@ static void s3c64xx_spi_set_cs(struct spi_device *spi, bool enable)
static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
{
struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi);
dma_filter_fn filter = sdd->cntrlr_info->filter;
struct device *dev = &sdd->pdev->dev;
dma_cap_mask_t mask;

if (is_polling(sdd))
return 0;

dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);

/* Acquire DMA channels */
sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter,
sdd->cntrlr_info->dma_rx, dev, "rx");
sdd->rx_dma.ch = dma_request_slave_channel(dev, "rx");
if (!sdd->rx_dma.ch) {
dev_err(dev, "Failed to get RX DMA channel\n");
return -EBUSY;
}
spi->dma_rx = sdd->rx_dma.ch;

sdd->tx_dma.ch = dma_request_slave_channel_compat(mask, filter,
sdd->cntrlr_info->dma_tx, dev, "tx");
sdd->tx_dma.ch = dma_request_slave_channel(dev, "tx");
if (!sdd->tx_dma.ch) {
dev_err(dev, "Failed to get TX DMA channel\n");
dma_release_channel(sdd->rx_dma.ch);
Expand Down Expand Up @@ -1091,11 +1084,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)

sdd->cur_bpw = 8;

if (!sdd->pdev->dev.of_node && (!sci->dma_tx || !sci->dma_rx)) {
dev_warn(&pdev->dev, "Unable to get SPI tx/rx DMA data. Switching to poll mode\n");
sdd->port_conf->quirks = S3C64XX_SPI_QUIRK_POLL;
}

sdd->tx_dma.direction = DMA_MEM_TO_DEV;
sdd->rx_dma.direction = DMA_DEV_TO_MEM;

Expand Down Expand Up @@ -1205,9 +1193,8 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)

dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached\n",
sdd->port_id, master->num_chipselect);
dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\tDMA=[Rx-%p, Tx-%p]\n",
mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1,
sci->dma_rx, sci->dma_tx);
dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\n",
mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1);

pm_runtime_mark_last_busy(&pdev->dev);
pm_runtime_put_autosuspend(&pdev->dev);
Expand Down

0 comments on commit 6f8dc9d

Please sign in to comment.