diff options
author | Haijun Zhang <Haijun.Zhang@freescale.com> | 2013-10-23 04:45:20 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2013-12-18 19:24:30 (GMT) |
commit | e7b2a3afbde7354eed7ccd1f9cfe21ba0414143e (patch) | |
tree | 82cfa023bc4d086a24177a54e09d9ffedc65ea10 /drivers/mmc/host | |
parent | 77e1e15aeac84a6e81acfd44afa771a8cc8cdafd (diff) | |
download | linux-fsl-qoriq-e7b2a3afbde7354eed7ccd1f9cfe21ba0414143e.tar.xz |
sdhci: Add Auto-CMD12 err detecting and handling routine
When Auto-CMD12 is enabled, Auto-cmd12 error status and signal
bit should be set to reflect this behaviour in case error.
Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
Change-Id: Ief2ca5fad7861154c03cc1aa28e130f42d79e27b
Reviewed-on: http://git.am.freescale.net:8181/5928
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Xiaobo Xie <X.Xie@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 811682f..bfb3d8e 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -252,6 +252,9 @@ static void sdhci_init(struct sdhci_host *host, int soft) if (pltm_irq) irq |= pltm_irq; + if (host->flags & SDHCI_AUTO_CMD12) + irq |= SDHCI_INT_ACMD12ERR; + sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, irq); if (soft) { @@ -2261,7 +2264,7 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) if (intmask & SDHCI_INT_TIMEOUT) host->cmd->error = -ETIMEDOUT; else if (intmask & (SDHCI_INT_CRC | SDHCI_INT_END_BIT | - SDHCI_INT_INDEX)) + SDHCI_INT_INDEX | SDHCI_INT_ACMD12ERR)) host->cmd->error = -EILSEQ; if (host->ops->handle_platform_irq) @@ -2435,6 +2438,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) struct sdhci_host *host = dev_id; u32 intmask, unexpected = 0; int cardint = 0, max_loops = 16; + u32 cmd_mask = SDHCI_INT_CMD_MASK; spin_lock(&host->lock); @@ -2481,10 +2485,9 @@ again: tasklet_schedule(&host->card_tasklet); } - if (intmask & SDHCI_INT_CMD_MASK) { - sdhci_writel(host, intmask & SDHCI_INT_CMD_MASK, - SDHCI_INT_STATUS); - sdhci_cmd_irq(host, intmask & SDHCI_INT_CMD_MASK); + if (intmask & cmd_mask) { + sdhci_writel(host, intmask & cmd_mask, SDHCI_INT_STATUS); + sdhci_cmd_irq(host, intmask & cmd_mask); } if (intmask & SDHCI_INT_DATA_MASK) { @@ -2493,7 +2496,7 @@ again: sdhci_data_irq(host, intmask & SDHCI_INT_DATA_MASK); } - intmask &= ~(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK); + intmask &= ~(cmd_mask | SDHCI_INT_DATA_MASK); intmask &= ~SDHCI_INT_ERROR; |