summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/tmio_mmc_dma.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-04-26 19:47:19 +0400
committerChris Ball <cjb@laptop.org>2013-05-26 22:23:21 +0400
commit87ae7bbebd9c9b32ad49dde1742aa68b5a86caf8 (patch)
tree9ecb5f53bf34f342631db33ed2d4d307f48d3ff4 /drivers/mmc/host/tmio_mmc_dma.c
parenteec95ee22611f2207bd991d63a07884de28e6f56 (diff)
downloadlinux-87ae7bbebd9c9b32ad49dde1742aa68b5a86caf8.tar.xz
mmc: sdhi/tmio: add DT DMA support
Add support for initialising DMA from the Device Tree. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/tmio_mmc_dma.c')
-rw-r--r--drivers/mmc/host/tmio_mmc_dma.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 5fcf14f21d20..47bdb8fa341b 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -264,7 +264,8 @@ out:
void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdata)
{
/* We can only either use DMA for both Tx and Rx or not use it at all */
- if (!pdata->dma)
+ if (!pdata->dma || (!host->pdev->dev.of_node &&
+ (!pdata->dma->chan_priv_tx || !pdata->dma->chan_priv_rx)))
return;
if (!host->chan_tx && !host->chan_rx) {
@@ -280,15 +281,17 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
- host->chan_tx = dma_request_channel(mask, pdata->dma->filter,
- pdata->dma->chan_priv_tx);
+ host->chan_tx = dma_request_slave_channel_compat(mask,
+ pdata->dma->filter, pdata->dma->chan_priv_tx,
+ &host->pdev->dev, "tx");
dev_dbg(&host->pdev->dev, "%s: TX: got channel %p\n", __func__,
host->chan_tx);
if (!host->chan_tx)
return;
- cfg.slave_id = pdata->dma->slave_id_tx;
+ if (pdata->dma->chan_priv_tx)
+ cfg.slave_id = pdata->dma->slave_id_tx;
cfg.direction = DMA_MEM_TO_DEV;
cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->bus_shift);
cfg.src_addr = 0;
@@ -296,15 +299,17 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
if (ret < 0)
goto ecfgtx;
- host->chan_rx = dma_request_channel(mask, pdata->dma->filter,
- pdata->dma->chan_priv_rx);
+ host->chan_rx = dma_request_slave_channel_compat(mask,
+ pdata->dma->filter, pdata->dma->chan_priv_rx,
+ &host->pdev->dev, "rx");
dev_dbg(&host->pdev->dev, "%s: RX: got channel %p\n", __func__,
host->chan_rx);
if (!host->chan_rx)
goto ereqrx;
- cfg.slave_id = pdata->dma->slave_id_rx;
+ if (pdata->dma->chan_priv_rx)
+ cfg.slave_id = pdata->dma->slave_id_rx;
cfg.direction = DMA_DEV_TO_MEM;
cfg.src_addr = cfg.dst_addr;
cfg.dst_addr = 0;