summaryrefslogtreecommitdiff
path: root/drivers/base/regmap/internal.h
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-07-20 22:56:53 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-08 15:57:00 +0900
commit31244e396fa9e4854cfd6dfe305983e77802c156 (patch)
treed2d9b4403802e8536e83304b3024352ba529f1fe /drivers/base/regmap/internal.h
parent93de91245b66f20dd387c2745744950a11a5c436 (diff)
downloadlinux-3.10-31244e396fa9e4854cfd6dfe305983e77802c156.tar.gz
linux-3.10-31244e396fa9e4854cfd6dfe305983e77802c156.tar.bz2
linux-3.10-31244e396fa9e4854cfd6dfe305983e77802c156.zip
regmap: Provide register map dump via debugfs
Copy over the read parts of the ASoC debugfs implementation into regmap, allowing users to see what the register values the device has are at runtime. The implementation, especially the support for seeking, is mostly due to Dimitris Papastamos' work in ASoC. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap/internal.h')
-rw-r--r--drivers/base/regmap/internal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index 7e61504a7ac..78f87f316a1 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -14,6 +14,7 @@
#define _REGMAP_INTERNAL_H
#include <linux/regmap.h>
+#include <linux/fs.h>
struct regmap;
@@ -36,10 +37,24 @@ struct regmap {
struct regmap_format format; /* Buffer format */
const struct regmap_bus *bus;
+#ifdef CONFIG_DEBUG_FS
+ struct dentry *debugfs;
+#endif
+
unsigned int max_register;
bool (*writeable_reg)(struct device *dev, unsigned int reg);
bool (*readable_reg)(struct device *dev, unsigned int reg);
bool (*volatile_reg)(struct device *dev, unsigned int reg);
};
+#ifdef CONFIG_DEBUG_FS
+extern void regmap_debugfs_initcall(void);
+extern void regmap_debugfs_init(struct regmap *map);
+extern void regmap_debugfs_exit(struct regmap *map);
+#else
+void regmap_debugfs_initcall(void) { }
+void regmap_debugfs_init(struct regmap *map) { }
+void regmap_debugfs_exit(struct regmap *map) { }
+#endif
+
#endif