提交 f3e2f1dd 编写于 作者: G Grazvydas Ignotas 提交者: Pierre Ossman

omap_hsmmc: Fix MMC3 dma

Data transfers on third OMAP3 MMC controller don't work
because DMA line numbers are only defined for MMC1 and MMC2.
Fix that and store line numbers in mmc_omap_host structure
to reduce code size.
Tested on OMAP3 pandora board.
Signed-off-by: NGrazvydas Ignotas <notasas@gmail.com>
Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
上级 0683af48
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
*/ */
#define OMAP_MMC1_DEVID 0 #define OMAP_MMC1_DEVID 0
#define OMAP_MMC2_DEVID 1 #define OMAP_MMC2_DEVID 1
#define OMAP_MMC3_DEVID 2
#define MMC_TIMEOUT_MS 20 #define MMC_TIMEOUT_MS 20
#define OMAP_MMC_MASTER_CLOCK 96000000 #define OMAP_MMC_MASTER_CLOCK 96000000
...@@ -144,6 +145,7 @@ struct mmc_omap_host { ...@@ -144,6 +145,7 @@ struct mmc_omap_host {
int irq; int irq;
int carddetect; int carddetect;
int use_dma, dma_ch; int use_dma, dma_ch;
int dma_line_tx, dma_line_rx;
int slot_id; int slot_id;
int dbclk_enabled; int dbclk_enabled;
int response_busy; int response_busy;
...@@ -602,17 +604,10 @@ static int mmc_omap_get_dma_sync_dev(struct mmc_omap_host *host, ...@@ -602,17 +604,10 @@ static int mmc_omap_get_dma_sync_dev(struct mmc_omap_host *host,
{ {
int sync_dev; int sync_dev;
if (data->flags & MMC_DATA_WRITE) { if (data->flags & MMC_DATA_WRITE)
if (host->id == OMAP_MMC1_DEVID) sync_dev = host->dma_line_tx;
sync_dev = OMAP24XX_DMA_MMC1_TX; else
else sync_dev = host->dma_line_rx;
sync_dev = OMAP24XX_DMA_MMC2_TX;
} else {
if (host->id == OMAP_MMC1_DEVID)
sync_dev = OMAP24XX_DMA_MMC1_RX;
else
sync_dev = OMAP24XX_DMA_MMC2_RX;
}
return sync_dev; return sync_dev;
} }
...@@ -1075,6 +1070,25 @@ static int __init omap_mmc_probe(struct platform_device *pdev) ...@@ -1075,6 +1070,25 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
omap_hsmmc_init(host); omap_hsmmc_init(host);
/* Select DMA lines */
switch (host->id) {
case OMAP_MMC1_DEVID:
host->dma_line_tx = OMAP24XX_DMA_MMC1_TX;
host->dma_line_rx = OMAP24XX_DMA_MMC1_RX;
break;
case OMAP_MMC2_DEVID:
host->dma_line_tx = OMAP24XX_DMA_MMC2_TX;
host->dma_line_rx = OMAP24XX_DMA_MMC2_RX;
break;
case OMAP_MMC3_DEVID:
host->dma_line_tx = OMAP34XX_DMA_MMC3_TX;
host->dma_line_rx = OMAP34XX_DMA_MMC3_RX;
break;
default:
dev_err(mmc_dev(host->mmc), "Invalid MMC id\n");
goto err_irq;
}
/* Request IRQ for MMC operations */ /* Request IRQ for MMC operations */
ret = request_irq(host->irq, mmc_omap_irq, IRQF_DISABLED, ret = request_irq(host->irq, mmc_omap_irq, IRQF_DISABLED,
mmc_hostname(mmc), host); mmc_hostname(mmc), host);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册