From: Francisco Alecrim Date: Mon, 18 Aug 2008 15:13:17 +0000 (+0300) Subject: MMC: OMAP: Readable output for IRQ status register X-Git-Tag: v2.6.27-omap1~219 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=8faa54f8054e33fd2b5d6da40fbbda3cbc6fa348;p=linux-2.6-omap-h63xx.git MMC: OMAP: Readable output for IRQ status register Readable output for IRQ status register Signed-off-by: Francisco Alecrim Acked-by: Anderson Lizardo Signed-off-by: Tony Lindgren --- diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 9462e4c34b2..92ead50147d 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -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) {