diff options
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 283265154944..61883093e25b 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -100,6 +100,7 @@ | |||
100 | */ | 100 | */ |
101 | #define OMAP_MMC1_DEVID 0 | 101 | #define OMAP_MMC1_DEVID 0 |
102 | #define OMAP_MMC2_DEVID 1 | 102 | #define OMAP_MMC2_DEVID 1 |
103 | #define OMAP_MMC3_DEVID 2 | ||
103 | 104 | ||
104 | #define MMC_TIMEOUT_MS 20 | 105 | #define MMC_TIMEOUT_MS 20 |
105 | #define OMAP_MMC_MASTER_CLOCK 96000000 | 106 | #define OMAP_MMC_MASTER_CLOCK 96000000 |
@@ -144,6 +145,7 @@ struct mmc_omap_host { | |||
144 | int irq; | 145 | int irq; |
145 | int carddetect; | 146 | int carddetect; |
146 | int use_dma, dma_ch; | 147 | int use_dma, dma_ch; |
148 | int dma_line_tx, dma_line_rx; | ||
147 | int slot_id; | 149 | int slot_id; |
148 | int dbclk_enabled; | 150 | int dbclk_enabled; |
149 | int response_busy; | 151 | int response_busy; |
@@ -602,17 +604,10 @@ static int mmc_omap_get_dma_sync_dev(struct mmc_omap_host *host, | |||
602 | { | 604 | { |
603 | int sync_dev; | 605 | int sync_dev; |
604 | 606 | ||
605 | if (data->flags & MMC_DATA_WRITE) { | 607 | if (data->flags & MMC_DATA_WRITE) |
606 | if (host->id == OMAP_MMC1_DEVID) | 608 | sync_dev = host->dma_line_tx; |
607 | sync_dev = OMAP24XX_DMA_MMC1_TX; | 609 | else |
608 | else | 610 | sync_dev = host->dma_line_rx; |
609 | sync_dev = OMAP24XX_DMA_MMC2_TX; | ||
610 | } else { | ||
611 | if (host->id == OMAP_MMC1_DEVID) | ||
612 | sync_dev = OMAP24XX_DMA_MMC1_RX; | ||
613 | else | ||
614 | sync_dev = OMAP24XX_DMA_MMC2_RX; | ||
615 | } | ||
616 | return sync_dev; | 611 | return sync_dev; |
617 | } | 612 | } |
618 | 613 | ||
@@ -1075,6 +1070,25 @@ static int __init omap_mmc_probe(struct platform_device *pdev) | |||
1075 | 1070 | ||
1076 | omap_hsmmc_init(host); | 1071 | omap_hsmmc_init(host); |
1077 | 1072 | ||
1073 | /* Select DMA lines */ | ||
1074 | switch (host->id) { | ||
1075 | case OMAP_MMC1_DEVID: | ||
1076 | host->dma_line_tx = OMAP24XX_DMA_MMC1_TX; | ||
1077 | host->dma_line_rx = OMAP24XX_DMA_MMC1_RX; | ||
1078 | break; | ||
1079 | case OMAP_MMC2_DEVID: | ||
1080 | host->dma_line_tx = OMAP24XX_DMA_MMC2_TX; | ||
1081 | host->dma_line_rx = OMAP24XX_DMA_MMC2_RX; | ||
1082 | break; | ||
1083 | case OMAP_MMC3_DEVID: | ||
1084 | host->dma_line_tx = OMAP34XX_DMA_MMC3_TX; | ||
1085 | host->dma_line_rx = OMAP34XX_DMA_MMC3_RX; | ||
1086 | break; | ||
1087 | default: | ||
1088 | dev_err(mmc_dev(host->mmc), "Invalid MMC id\n"); | ||
1089 | goto err_irq; | ||
1090 | } | ||
1091 | |||
1078 | /* Request IRQ for MMC operations */ | 1092 | /* Request IRQ for MMC operations */ |
1079 | ret = request_irq(host->irq, mmc_omap_irq, IRQF_DISABLED, | 1093 | ret = request_irq(host->irq, mmc_omap_irq, IRQF_DISABLED, |
1080 | mmc_hostname(mmc), host); | 1094 | mmc_hostname(mmc), host); |