Commit e2b05099 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mark Brown

spi: rspi: provide port addresses to dmaengine driver via slave configuration

Don't rely on shdma dhaengine driver getting DMA slave addresses from its
slave configuration. Instead provide those addresses, using a
dmaengine_slave_config() call.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 5ae90d8e
...@@ -664,12 +664,13 @@ static irqreturn_t rspi_irq(int irq, void *_sr) ...@@ -664,12 +664,13 @@ static irqreturn_t rspi_irq(int irq, void *_sr)
static int rspi_request_dma(struct rspi_data *rspi, static int rspi_request_dma(struct rspi_data *rspi,
struct platform_device *pdev) struct platform_device *pdev)
{ {
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
struct rspi_plat_data *rspi_pd = pdev->dev.platform_data; struct rspi_plat_data *rspi_pd = pdev->dev.platform_data;
dma_cap_mask_t mask; dma_cap_mask_t mask;
struct dma_slave_config cfg; struct dma_slave_config cfg;
int ret; int ret;
if (!rspi_pd) if (!res || !rspi_pd)
return 0; /* The driver assumes no error. */ return 0; /* The driver assumes no error. */
rspi->dma_width_16bit = rspi_pd->dma_width_16bit; rspi->dma_width_16bit = rspi_pd->dma_width_16bit;
...@@ -683,6 +684,8 @@ static int rspi_request_dma(struct rspi_data *rspi, ...@@ -683,6 +684,8 @@ static int rspi_request_dma(struct rspi_data *rspi,
if (rspi->chan_rx) { if (rspi->chan_rx) {
cfg.slave_id = rspi_pd->dma_rx_id; cfg.slave_id = rspi_pd->dma_rx_id;
cfg.direction = DMA_DEV_TO_MEM; cfg.direction = DMA_DEV_TO_MEM;
cfg.dst_addr = 0;
cfg.src_addr = res->start + RSPI_SPDR;
ret = dmaengine_slave_config(rspi->chan_rx, &cfg); ret = dmaengine_slave_config(rspi->chan_rx, &cfg);
if (!ret) if (!ret)
dev_info(&pdev->dev, "Use DMA when rx.\n"); dev_info(&pdev->dev, "Use DMA when rx.\n");
...@@ -698,6 +701,8 @@ static int rspi_request_dma(struct rspi_data *rspi, ...@@ -698,6 +701,8 @@ static int rspi_request_dma(struct rspi_data *rspi,
if (rspi->chan_tx) { if (rspi->chan_tx) {
cfg.slave_id = rspi_pd->dma_tx_id; cfg.slave_id = rspi_pd->dma_tx_id;
cfg.direction = DMA_MEM_TO_DEV; cfg.direction = DMA_MEM_TO_DEV;
cfg.dst_addr = res->start + RSPI_SPDR;
cfg.src_addr = 0;
ret = dmaengine_slave_config(rspi->chan_tx, &cfg); ret = dmaengine_slave_config(rspi->chan_tx, &cfg);
if (!ret) if (!ret)
dev_info(&pdev->dev, "Use DMA when tx\n"); dev_info(&pdev->dev, "Use DMA when tx\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment