diff options
author | Denis Karpov <ext-denis.2.karpov@nokia.com> | 2009-09-22 19:44:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:34 -0400 |
commit | d900f7128cf73d77467209672db2dcf0ff02dde6 (patch) | |
tree | 1ff5f9412a7c23b7de7d6dee42512515dd00b077 /drivers/mmc/host/omap_hsmmc.c | |
parent | ef0b27d4ccacac32afc3d1c0e8a95e4091dfbc8c (diff) |
omap_hsmmc: add debugfs entry (host registers)
Adds <debugfs_root>/kernel/debug/mmc<N>/regs entry, contents show
registers' state and some driver internal state variables.
Signed-off-by: Denis Karpov <ext-denis.2.karpov@nokia.com>
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Matt Fleming <matt@console-pimps.org>
Cc: Ian Molton <ian@mnementh.co.uk>
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com>
Cc: Pierre Ossman <pierre@ossman.eu>
Cc: Philip Langdale <philipl@overt.org>
Cc: "Madhusudhan" <madhu.cr@ti.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc/host/omap_hsmmc.c')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 4b3af9e11b7b..259c07d61a81 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -17,6 +17,8 @@ | |||
17 | 17 | ||
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/debugfs.h> | ||
21 | #include <linux/seq_file.h> | ||
20 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
21 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
22 | #include <linux/dma-mapping.h> | 24 | #include <linux/dma-mapping.h> |
@@ -974,6 +976,59 @@ static struct mmc_host_ops mmc_omap_ops = { | |||
974 | /* NYET -- enable_sdio_irq */ | 976 | /* NYET -- enable_sdio_irq */ |
975 | }; | 977 | }; |
976 | 978 | ||
979 | #ifdef CONFIG_DEBUG_FS | ||
980 | |||
981 | static int mmc_regs_show(struct seq_file *s, void *data) | ||
982 | { | ||
983 | struct mmc_host *mmc = s->private; | ||
984 | struct mmc_omap_host *host = mmc_priv(mmc); | ||
985 | |||
986 | seq_printf(s, "mmc%d regs:\n", mmc->index); | ||
987 | |||
988 | seq_printf(s, "SYSCONFIG:\t0x%08x\n", | ||
989 | OMAP_HSMMC_READ(host->base, SYSCONFIG)); | ||
990 | seq_printf(s, "CON:\t\t0x%08x\n", | ||
991 | OMAP_HSMMC_READ(host->base, CON)); | ||
992 | seq_printf(s, "HCTL:\t\t0x%08x\n", | ||
993 | OMAP_HSMMC_READ(host->base, HCTL)); | ||
994 | seq_printf(s, "SYSCTL:\t\t0x%08x\n", | ||
995 | OMAP_HSMMC_READ(host->base, SYSCTL)); | ||
996 | seq_printf(s, "IE:\t\t0x%08x\n", | ||
997 | OMAP_HSMMC_READ(host->base, IE)); | ||
998 | seq_printf(s, "ISE:\t\t0x%08x\n", | ||
999 | OMAP_HSMMC_READ(host->base, ISE)); | ||
1000 | seq_printf(s, "CAPA:\t\t0x%08x\n", | ||
1001 | OMAP_HSMMC_READ(host->base, CAPA)); | ||
1002 | return 0; | ||
1003 | } | ||
1004 | |||
1005 | static int mmc_regs_open(struct inode *inode, struct file *file) | ||
1006 | { | ||
1007 | return single_open(file, mmc_regs_show, inode->i_private); | ||
1008 | } | ||
1009 | |||
1010 | static const struct file_operations mmc_regs_fops = { | ||
1011 | .open = mmc_regs_open, | ||
1012 | .read = seq_read, | ||
1013 | .llseek = seq_lseek, | ||
1014 | .release = single_release, | ||
1015 | }; | ||
1016 | |||
1017 | static void omap_mmc_debugfs(struct mmc_host *mmc) | ||
1018 | { | ||
1019 | if (mmc->debugfs_root) | ||
1020 | debugfs_create_file("regs", S_IRUSR, mmc->debugfs_root, | ||
1021 | mmc, &mmc_regs_fops); | ||
1022 | } | ||
1023 | |||
1024 | #else | ||
1025 | |||
1026 | static void omap_mmc_debugfs(struct mmc_host *mmc) | ||
1027 | { | ||
1028 | } | ||
1029 | |||
1030 | #endif | ||
1031 | |||
977 | static int __init omap_mmc_probe(struct platform_device *pdev) | 1032 | static int __init omap_mmc_probe(struct platform_device *pdev) |
978 | { | 1033 | { |
979 | struct omap_mmc_platform_data *pdata = pdev->dev.platform_data; | 1034 | struct omap_mmc_platform_data *pdata = pdev->dev.platform_data; |
@@ -1157,6 +1212,8 @@ static int __init omap_mmc_probe(struct platform_device *pdev) | |||
1157 | goto err_cover_switch; | 1212 | goto err_cover_switch; |
1158 | } | 1213 | } |
1159 | 1214 | ||
1215 | omap_mmc_debugfs(mmc); | ||
1216 | |||
1160 | return 0; | 1217 | return 0; |
1161 | 1218 | ||
1162 | err_cover_switch: | 1219 | err_cover_switch: |