diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-08-02 09:03:42 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-02 12:28:43 -0400 |
commit | e2b0509908aa5e874a1837a733422b6e8b8502b8 (patch) | |
tree | 166e61ae2031ef4d7264eb165f6f460d61cbdf43 /drivers/spi/spi-rspi.c | |
parent | 5ae90d8e467e625e447000cb4335c4db973b1095 (diff) |
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: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-rspi.c')
-rw-r--r-- | drivers/spi/spi-rspi.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index b44a6ac3cec9..5f122d9d2063 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c | |||
@@ -664,12 +664,13 @@ static irqreturn_t rspi_irq(int irq, void *_sr) | |||
664 | static int rspi_request_dma(struct rspi_data *rspi, | 664 | static int rspi_request_dma(struct rspi_data *rspi, |
665 | struct platform_device *pdev) | 665 | struct platform_device *pdev) |
666 | { | 666 | { |
667 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
667 | struct rspi_plat_data *rspi_pd = pdev->dev.platform_data; | 668 | struct rspi_plat_data *rspi_pd = pdev->dev.platform_data; |
668 | dma_cap_mask_t mask; | 669 | dma_cap_mask_t mask; |
669 | struct dma_slave_config cfg; | 670 | struct dma_slave_config cfg; |
670 | int ret; | 671 | int ret; |
671 | 672 | ||
672 | if (!rspi_pd) | 673 | if (!res || !rspi_pd) |
673 | return 0; /* The driver assumes no error. */ | 674 | return 0; /* The driver assumes no error. */ |
674 | 675 | ||
675 | rspi->dma_width_16bit = rspi_pd->dma_width_16bit; | 676 | rspi->dma_width_16bit = rspi_pd->dma_width_16bit; |
@@ -683,6 +684,8 @@ static int rspi_request_dma(struct rspi_data *rspi, | |||
683 | if (rspi->chan_rx) { | 684 | if (rspi->chan_rx) { |
684 | cfg.slave_id = rspi_pd->dma_rx_id; | 685 | cfg.slave_id = rspi_pd->dma_rx_id; |
685 | cfg.direction = DMA_DEV_TO_MEM; | 686 | cfg.direction = DMA_DEV_TO_MEM; |
687 | cfg.dst_addr = 0; | ||
688 | cfg.src_addr = res->start + RSPI_SPDR; | ||
686 | ret = dmaengine_slave_config(rspi->chan_rx, &cfg); | 689 | ret = dmaengine_slave_config(rspi->chan_rx, &cfg); |
687 | if (!ret) | 690 | if (!ret) |
688 | dev_info(&pdev->dev, "Use DMA when rx.\n"); | 691 | dev_info(&pdev->dev, "Use DMA when rx.\n"); |
@@ -698,6 +701,8 @@ static int rspi_request_dma(struct rspi_data *rspi, | |||
698 | if (rspi->chan_tx) { | 701 | if (rspi->chan_tx) { |
699 | cfg.slave_id = rspi_pd->dma_tx_id; | 702 | cfg.slave_id = rspi_pd->dma_tx_id; |
700 | cfg.direction = DMA_MEM_TO_DEV; | 703 | cfg.direction = DMA_MEM_TO_DEV; |
704 | cfg.dst_addr = res->start + RSPI_SPDR; | ||
705 | cfg.src_addr = 0; | ||
701 | ret = dmaengine_slave_config(rspi->chan_tx, &cfg); | 706 | ret = dmaengine_slave_config(rspi->chan_tx, &cfg); |
702 | if (!ret) | 707 | if (!ret) |
703 | dev_info(&pdev->dev, "Use DMA when tx\n"); | 708 | dev_info(&pdev->dev, "Use DMA when tx\n"); |