]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
MMC: OMAP: Readable output for IRQ status register
authorFrancisco Alecrim <francisco.alecrim@indt.org.br>
Mon, 18 Aug 2008 15:13:17 +0000 (18:13 +0300)
committerTony Lindgren <tony@atomide.com>
Thu, 11 Sep 2008 00:01:03 +0000 (17:01 -0700)
Readable output for IRQ status register

Signed-off-by: Francisco Alecrim <francisco.alecrim@indt.org.br>
Acked-by: Anderson Lizardo <anderson.lizardo@indt.org.br>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/mmc/host/omap_hsmmc.c

index 9462e4c34b2c40705065d2fef8e61cf67cce19f3..92ead50147d40782a5a0c1017997763296c912d8 100644 (file)
@@ -296,6 +296,37 @@ static void mmc_dma_cleanup(struct mmc_omap_host *host)
        host->datadir = OMAP_MMC_DATADIR_NONE;
 }
 
+/*
+ * 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
  */
@@ -316,6 +347,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) {