aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBalaji T K <balajitk@ti.com>2012-03-07 09:55:30 -0500
committerChris Ball <cjb@laptop.org>2012-03-27 12:19:59 -0400
commitb7bf773b0eaac633276a8c3b2867db4d8b64c04a (patch)
tree4ec8fcebe74616c86aaf6219441969e8b6c50310
parentf0cc9cf99326926fd76f77645c48d16d647802eb (diff)
mmc: omap_hsmmc: use platform_get_resource_byname for tx/rx DMA channels
Git rid of hardcoded tx/rx DMA channels based on pdev->id and use platform_get_resource_byname() to retrieve them instead. Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Rajendra Nayak <rnayak@ti.com> Tested-by: Venkatraman S <svenkatr@ti.com> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/omap_hsmmc.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 36e7f5bc58a3..a6f19f17f0d8 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1981,32 +1981,19 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
1981 1981
1982 omap_hsmmc_conf_bus_power(host); 1982 omap_hsmmc_conf_bus_power(host);
1983 1983
1984 /* Select DMA lines */ 1984 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
1985 switch (host->id) { 1985 if (!res) {
1986 case OMAP_MMC1_DEVID: 1986 dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
1987 host->dma_line_tx = OMAP24XX_DMA_MMC1_TX; 1987 goto err_irq;
1988 host->dma_line_rx = OMAP24XX_DMA_MMC1_RX; 1988 }
1989 break; 1989 host->dma_line_tx = res->start;
1990 case OMAP_MMC2_DEVID: 1990
1991 host->dma_line_tx = OMAP24XX_DMA_MMC2_TX; 1991 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
1992 host->dma_line_rx = OMAP24XX_DMA_MMC2_RX; 1992 if (!res) {
1993 break; 1993 dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
1994 case OMAP_MMC3_DEVID:
1995 host->dma_line_tx = OMAP34XX_DMA_MMC3_TX;
1996 host->dma_line_rx = OMAP34XX_DMA_MMC3_RX;
1997 break;
1998 case OMAP_MMC4_DEVID:
1999 host->dma_line_tx = OMAP44XX_DMA_MMC4_TX;
2000 host->dma_line_rx = OMAP44XX_DMA_MMC4_RX;
2001 break;
2002 case OMAP_MMC5_DEVID:
2003 host->dma_line_tx = OMAP44XX_DMA_MMC5_TX;
2004 host->dma_line_rx = OMAP44XX_DMA_MMC5_RX;
2005 break;
2006 default:
2007 dev_err(mmc_dev(host->mmc), "Invalid MMC id\n");
2008 goto err_irq; 1994 goto err_irq;
2009 } 1995 }
1996 host->dma_line_rx = res->start;
2010 1997
2011 /* Request IRQ for MMC operations */ 1998 /* Request IRQ for MMC operations */
2012 ret = request_irq(host->irq, omap_hsmmc_irq, 0, 1999 ret = request_irq(host->irq, omap_hsmmc_irq, 0,