diff options
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mmc.h | 3 | ||||
-rw-r--r-- | drivers/mmc/host/mxcmmc.c | 16 |
2 files changed, 16 insertions, 3 deletions
diff --git a/arch/arm/plat-mxc/include/mach/mmc.h b/arch/arm/plat-mxc/include/mach/mmc.h index de2128dada5c..29115f405af9 100644 --- a/arch/arm/plat-mxc/include/mach/mmc.h +++ b/arch/arm/plat-mxc/include/mach/mmc.h | |||
@@ -31,6 +31,9 @@ struct imxmmc_platform_data { | |||
31 | 31 | ||
32 | /* adjust slot voltage */ | 32 | /* adjust slot voltage */ |
33 | void (*setpower)(struct device *, unsigned int vdd); | 33 | void (*setpower)(struct device *, unsigned int vdd); |
34 | |||
35 | /* enable card detect using DAT3 */ | ||
36 | int dat3_card_detect; | ||
34 | }; | 37 | }; |
35 | 38 | ||
36 | #endif | 39 | #endif |
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index ec18e3b60342..74c87e023866 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c | |||
@@ -119,6 +119,7 @@ struct mxcmci_host { | |||
119 | int detect_irq; | 119 | int detect_irq; |
120 | int dma; | 120 | int dma; |
121 | int do_dma; | 121 | int do_dma; |
122 | int default_irq_mask; | ||
122 | int use_sdio; | 123 | int use_sdio; |
123 | unsigned int power_mode; | 124 | unsigned int power_mode; |
124 | struct imxmmc_platform_data *pdata; | 125 | struct imxmmc_platform_data *pdata; |
@@ -228,7 +229,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data) | |||
228 | static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd, | 229 | static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd, |
229 | unsigned int cmdat) | 230 | unsigned int cmdat) |
230 | { | 231 | { |
231 | u32 int_cntr; | 232 | u32 int_cntr = host->default_irq_mask; |
232 | unsigned long flags; | 233 | unsigned long flags; |
233 | 234 | ||
234 | WARN_ON(host->cmd != NULL); | 235 | WARN_ON(host->cmd != NULL); |
@@ -275,7 +276,7 @@ static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd, | |||
275 | static void mxcmci_finish_request(struct mxcmci_host *host, | 276 | static void mxcmci_finish_request(struct mxcmci_host *host, |
276 | struct mmc_request *req) | 277 | struct mmc_request *req) |
277 | { | 278 | { |
278 | u32 int_cntr = 0; | 279 | u32 int_cntr = host->default_irq_mask; |
279 | unsigned long flags; | 280 | unsigned long flags; |
280 | 281 | ||
281 | spin_lock_irqsave(&host->lock, flags); | 282 | spin_lock_irqsave(&host->lock, flags); |
@@ -585,6 +586,9 @@ static irqreturn_t mxcmci_irq(int irq, void *devid) | |||
585 | (stat & (STATUS_DATA_TRANS_DONE | STATUS_WRITE_OP_DONE))) | 586 | (stat & (STATUS_DATA_TRANS_DONE | STATUS_WRITE_OP_DONE))) |
586 | mxcmci_data_done(host, stat); | 587 | mxcmci_data_done(host, stat); |
587 | #endif | 588 | #endif |
589 | if (host->default_irq_mask && | ||
590 | (stat & (STATUS_CARD_INSERTION | STATUS_CARD_REMOVAL))) | ||
591 | mmc_detect_change(host->mmc, msecs_to_jiffies(200)); | ||
588 | return IRQ_HANDLED; | 592 | return IRQ_HANDLED; |
589 | } | 593 | } |
590 | 594 | ||
@@ -809,6 +813,12 @@ static int mxcmci_probe(struct platform_device *pdev) | |||
809 | else | 813 | else |
810 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; | 814 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; |
811 | 815 | ||
816 | if (host->pdata && host->pdata->dat3_card_detect) | ||
817 | host->default_irq_mask = | ||
818 | INT_CARD_INSERTION_EN | INT_CARD_REMOVAL_EN; | ||
819 | else | ||
820 | host->default_irq_mask = 0; | ||
821 | |||
812 | host->res = r; | 822 | host->res = r; |
813 | host->irq = irq; | 823 | host->irq = irq; |
814 | 824 | ||
@@ -835,7 +845,7 @@ static int mxcmci_probe(struct platform_device *pdev) | |||
835 | /* recommended in data sheet */ | 845 | /* recommended in data sheet */ |
836 | writew(0x2db4, host->base + MMC_REG_READ_TO); | 846 | writew(0x2db4, host->base + MMC_REG_READ_TO); |
837 | 847 | ||
838 | writel(0, host->base + MMC_REG_INT_CNTR); | 848 | writel(host->default_irq_mask, host->base + MMC_REG_INT_CNTR); |
839 | 849 | ||
840 | #ifdef HAS_DMA | 850 | #ifdef HAS_DMA |
841 | host->dma = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_LOW); | 851 | host->dma = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_LOW); |