aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/omap.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-11-26 18:50:33 -0500
committerTony Lindgren <tony@atomide.com>2013-11-26 18:50:33 -0500
commit31ee9181eb92cc727876ec5a2144a1b3cbdf5bb1 (patch)
tree4ebffd2b86323344e0bd9bc47ee80e9ac9494604 /drivers/mmc/host/omap.c
parent30023a7e4fef11c596fd7f3c323035c49dfaed85 (diff)
mmc: omap: Fix DMA configuration to not rely on device id
We are wrongly relying on device id for the DMA configuration which can lead to wrong DMA channel being selected. Fix the issue by using the standard resources like we should. Cc: linux-mmc@vger.kernel.org Acked-by: Chris Ball <cjb@laptop.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/mmc/host/omap.c')
-rw-r--r--drivers/mmc/host/omap.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 0b10a9030f4e..22995873f554 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -90,17 +90,6 @@
90#define OMAP_MMC_CMDTYPE_AC 2 90#define OMAP_MMC_CMDTYPE_AC 2
91#define OMAP_MMC_CMDTYPE_ADTC 3 91#define OMAP_MMC_CMDTYPE_ADTC 3
92 92
93#define OMAP_DMA_MMC_TX 21
94#define OMAP_DMA_MMC_RX 22
95#define OMAP_DMA_MMC2_TX 54
96#define OMAP_DMA_MMC2_RX 55
97
98#define OMAP24XX_DMA_MMC2_TX 47
99#define OMAP24XX_DMA_MMC2_RX 48
100#define OMAP24XX_DMA_MMC1_TX 61
101#define OMAP24XX_DMA_MMC1_RX 62
102
103
104#define DRIVER_NAME "mmci-omap" 93#define DRIVER_NAME "mmci-omap"
105 94
106/* Specifies how often in millisecs to poll for card status changes 95/* Specifies how often in millisecs to poll for card status changes
@@ -1330,7 +1319,7 @@ static int mmc_omap_probe(struct platform_device *pdev)
1330 struct mmc_omap_host *host = NULL; 1319 struct mmc_omap_host *host = NULL;
1331 struct resource *res; 1320 struct resource *res;
1332 dma_cap_mask_t mask; 1321 dma_cap_mask_t mask;
1333 unsigned sig; 1322 unsigned sig = 0;
1334 int i, ret = 0; 1323 int i, ret = 0;
1335 int irq; 1324 int irq;
1336 1325
@@ -1407,19 +1396,20 @@ static int mmc_omap_probe(struct platform_device *pdev)
1407 host->dma_tx_burst = -1; 1396 host->dma_tx_burst = -1;
1408 host->dma_rx_burst = -1; 1397 host->dma_rx_burst = -1;
1409 1398
1410 if (mmc_omap2()) 1399 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
1411 sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX; 1400 if (res)
1412 else 1401 sig = res->start;
1413 sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX; 1402 host->dma_tx = dma_request_slave_channel_compat(mask,
1414 host->dma_tx = dma_request_channel(mask, omap_dma_filter_fn, &sig); 1403 omap_dma_filter_fn, &sig, &pdev->dev, "tx");
1415 if (!host->dma_tx) 1404 if (!host->dma_tx)
1416 dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n", 1405 dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n",
1417 sig); 1406 sig);
1418 if (mmc_omap2()) 1407
1419 sig = host->id == 0 ? OMAP24XX_DMA_MMC1_RX : OMAP24XX_DMA_MMC2_RX; 1408 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
1420 else 1409 if (res)
1421 sig = host->id == 0 ? OMAP_DMA_MMC_RX : OMAP_DMA_MMC2_RX; 1410 sig = res->start;
1422 host->dma_rx = dma_request_channel(mask, omap_dma_filter_fn, &sig); 1411 host->dma_rx = dma_request_slave_channel_compat(mask,
1412 omap_dma_filter_fn, &sig, &pdev->dev, "rx");
1423 if (!host->dma_rx) 1413 if (!host->dma_rx)
1424 dev_warn(host->dev, "unable to obtain RX DMA engine channel %u\n", 1414 dev_warn(host->dev, "unable to obtain RX DMA engine channel %u\n",
1425 sig); 1415 sig);