提交 b7bf773b 编写于 作者: B Balaji T K 提交者: Chris Ball

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: NBalaji T K <balajitk@ti.com>
Signed-off-by: NRajendra Nayak <rnayak@ti.com>
Tested-by: NVenkatraman S <svenkatr@ti.com>
Signed-off-by: NChris Ball <cjb@laptop.org>
上级 f0cc9cf9
...@@ -1981,32 +1981,19 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) ...@@ -1981,32 +1981,19 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
omap_hsmmc_conf_bus_power(host); omap_hsmmc_conf_bus_power(host);
/* Select DMA lines */ res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
switch (host->id) { if (!res) {
case OMAP_MMC1_DEVID: dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
host->dma_line_tx = OMAP24XX_DMA_MMC1_TX; goto err_irq;
host->dma_line_rx = OMAP24XX_DMA_MMC1_RX; }
break; host->dma_line_tx = res->start;
case OMAP_MMC2_DEVID:
host->dma_line_tx = OMAP24XX_DMA_MMC2_TX; res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
host->dma_line_rx = OMAP24XX_DMA_MMC2_RX; if (!res) {
break; dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
case OMAP_MMC3_DEVID:
host->dma_line_tx = OMAP34XX_DMA_MMC3_TX;
host->dma_line_rx = OMAP34XX_DMA_MMC3_RX;
break;
case OMAP_MMC4_DEVID:
host->dma_line_tx = OMAP44XX_DMA_MMC4_TX;
host->dma_line_rx = OMAP44XX_DMA_MMC4_RX;
break;
case OMAP_MMC5_DEVID:
host->dma_line_tx = OMAP44XX_DMA_MMC5_TX;
host->dma_line_rx = OMAP44XX_DMA_MMC5_RX;
break;
default:
dev_err(mmc_dev(host->mmc), "Invalid MMC id\n");
goto err_irq; goto err_irq;
} }
host->dma_line_rx = res->start;
/* Request IRQ for MMC operations */ /* Request IRQ for MMC operations */
ret = request_irq(host->irq, omap_hsmmc_irq, 0, ret = request_irq(host->irq, omap_hsmmc_irq, 0,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册