[PATCH] mmc: dw_mmc: clear INSTS register when initialize

Joonyoung Shim
2013-04-18T05:21:18Z

If pending interrupt for IDMAC exists when probe, it will call interrupt
handler unnecessarily.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
drivers/mmc/host/dw_mmc.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 323c502..b0057a2 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2192,6 +2192,7 @@ int dw_mci_probe(struct dw_mci *host)

/* Clear the interrupts for the host controller */
mci_writel(host, RINTSTS, 0xFFFFFFFF);
+ mci_writel(host, IDSTS, 0xFFFFFFFF);
mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */

/* Put in max timeout */
@@ -2243,6 +2244,7 @@ int dw_mci_probe(struct dw_mci *host)
* receive ready and error such as transmit, receive timeout, crc error
*/
mci_writel(host, RINTSTS, 0xFFFFFFFF);
+ mci_writel(host, IDSTS, 0xFFFFFFFF);
mci_writel(host, INTMASK, SDMMC_INT_CMD_DONE | SDMMC_INT_DATA_OVER |
SDMMC_INT_TXDR | SDMMC_INT_RXDR |
DW_MCI_ERROR_FLAGS | SDMMC_INT_CD);
@@ -2393,6 +2395,7 @@ int dw_mci_resume(struct dw_mci *host)
mci_writel(host, FIFOTH, host->fifoth_val);

mci_writel(host, RINTSTS, 0xFFFFFFFF);
+ mci_writel(host, IDSTS, 0xFFFFFFFF);
mci_writel(host, INTMASK, SDMMC_INT_CMD_DONE | SDMMC_INT_DATA_OVER |
SDMMC_INT_TXDR | SDMMC_INT_RXDR |
DW_MCI_ERROR_FLAGS | SDMMC_INT_CD);
--
1.7.9.5