diff options
author | Haijun Zhang <Haijun.Zhang@freescale.com> | 2013-10-23 04:33:55 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2013-12-18 19:19:38 (GMT) |
commit | 31fa0d266a5b44dab69a61d77992df30734727fd (patch) | |
tree | ce16b7de24f40fe31412b5d1dbe7fc56aa5ccc35 /drivers | |
parent | f5cc56e30551b723ffc6f316161eda8cc555dfa5 (diff) | |
download | linux-fsl-qoriq-31fa0d266a5b44dab69a61d77992df30734727fd.tar.xz |
esdhc: Add vendor specific interrupt and handle routine
As spec detailed:
Error Interrupt Status Register(Offset 032h)[15-12]
Error Interrupt Status Enable Register (Offset 036h)[15-12]
Error Interrupt Signal Enable Register (Offset 03Ah)[15-12]
Bits above are specified by vendor itself.
So add interface to handle this requirememt.
Also share sdhci_dma_show in sdhc.h for platform usr.
Signed-off-by: Haijun Zhang <Haijun.Zhang@freescale.com>
Change-Id: If1203dcaed81ad5180395c755d779cb70e4fbbe6
Reviewed-on: http://git.am.freescale.net:8181/5926
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')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 24 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.h | 3 |
2 files changed, 20 insertions, 7 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 3c27e64..811682f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -237,16 +237,22 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios); static void sdhci_init(struct sdhci_host *host, int soft) { + u32 pltm_irq = 0, irq = 0; + if (soft) sdhci_reset(host, SDHCI_RESET_CMD|SDHCI_RESET_DATA); else sdhci_reset(host, SDHCI_RESET_ALL); - sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, - SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT | + irq = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT | SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX | SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT | - SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE); + SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE; + + if (pltm_irq) + irq |= pltm_irq; + + sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, irq); if (soft) { /* force clock reconfiguration */ @@ -2258,6 +2264,9 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) SDHCI_INT_INDEX)) host->cmd->error = -EILSEQ; + if (host->ops->handle_platform_irq) + host->ops->handle_platform_irq(host, intmask); + if (host->cmd->error) { tasklet_schedule(&host->finish_tasklet); return; @@ -2290,7 +2299,7 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) } #ifdef CONFIG_MMC_DEBUG -static void sdhci_show_adma_error(struct sdhci_host *host) +void sdhci_show_adma_error(struct sdhci_host *host) { const char *name = mmc_hostname(host->mmc); u8 *desc = host->adma_desc; @@ -2315,7 +2324,7 @@ static void sdhci_show_adma_error(struct sdhci_host *host) } } #else -static void sdhci_show_adma_error(struct sdhci_host *host) { } +void sdhci_show_adma_error(struct sdhci_host *host) { } #endif static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) @@ -2367,10 +2376,11 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) pr_err("%s: ADMA error\n", mmc_hostname(host->mmc)); sdhci_show_adma_error(host); host->data->error = -EIO; - if (host->ops->adma_workaround) - host->ops->adma_workaround(host, intmask); } + if (host->ops->handle_platform_irq) + host->ops->handle_platform_irq(host, intmask); + if (host->data->error) sdhci_finish_data(host); else { diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index a15c4c17..4e68539 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -295,6 +295,8 @@ struct sdhci_ops { void (*hw_reset)(struct sdhci_host *host); void (*platform_suspend)(struct sdhci_host *host); void (*platform_resume)(struct sdhci_host *host); + void (*get_platform_irq)(struct sdhci_host *host, u32 *irq); + void (*handle_platform_irq)(struct sdhci_host *host, u32 intmask); void (*adma_workaround)(struct sdhci_host *host, u32 intmask); void (*platform_init)(struct sdhci_host *host); void (*card_event)(struct sdhci_host *host); @@ -411,4 +413,5 @@ extern int sdhci_runtime_suspend_host(struct sdhci_host *host); extern int sdhci_runtime_resume_host(struct sdhci_host *host); #endif +extern void sdhci_show_adma_error(struct sdhci_host *host); #endif /* __SDHCI_HW_H */ |