From: Francisco Alecrim <[EMAIL PROTECTED]>

Readable output for IRQ status register

Signed-off-by: Francisco Alecrim <[EMAIL PROTECTED]>
Acked-by: Anderson Lizardo <[EMAIL PROTECTED]>
---
 drivers/mmc/host/omap_hsmmc.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index e361213..f5acf91 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -298,6 +298,37 @@ static void mmc_dma_cleanup(struct mmc_omap_host *host)
 }
 
 /*
+ * Readable error output
+ */
+#ifdef CONFIG_MMC_DEBUG
+static void mmc_omap_report_irq(struct mmc_omap_host *host, u32 status)
+{
+       /* --- means reserved bit without definition at documentation */
+       static const char *mmc_omap_status_bits[] = {
+               "CC", "TC", "BGE", "---", "BWR", "BRR", "---", "---", "CIRQ",
+               "OBI", "---", "---", "---", "---", "---", "ERRI", "CTO", "CCRC",
+               "CEB", "CIE", "DTO", "DCRC", "DEB", "---", "ACE", "---",
+               "---", "---", "---", "CERR", "CERR", "BADA", "---", "---", "---"
+       };
+       int i;
+
+       dev_dbg(mmc_dev(host->mmc), "MMC IRQ 0x%x :", status);
+
+       for (i = 0; i < ARRAY_SIZE(mmc_omap_status_bits); i++)
+               if (status & (1 << i))
+                       /*
+                        * KERN_* facility is not used here because this should
+                        * print a single line.
+                        */
+                       printk(" %s", mmc_omap_status_bits[i]);
+
+       printk("\n");
+
+}
+#endif  /* CONFIG_MMC_DEBUG */
+
+
+/*
  * MMC controller IRQ handler
  */
 static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
@@ -317,6 +348,9 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
        dev_dbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status);
 
        if (status & ERR) {
+#ifdef CONFIG_MMC_DEBUG
+               mmc_omap_report_irq(host, status);
+#endif
                if ((status & CMD_TIMEOUT) ||
                        (status & CMD_CRC)) {
                        if (host->cmd) {
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to