aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/debugfs.h
diff options
context:
space:
mode:
authorAlessandro Rubini <rubini@gnudd.com>2011-11-18 08:50:21 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-18 13:31:22 -0500
commit1a087c6ad975bcc193b4bab2e9d61f9c6c547138 (patch)
tree207b0b121a2e5a48613e9225beb1c49ca67a92a7 /include/linux/debugfs.h
parentfe7484834bb614c2c205726647635171ce6cc070 (diff)
debugfs: add tools to printk 32-bit registers
Some debugfs file I deal with are mostly blocks of registers, i.e. lines of the form "<name> = 0x<value>". Some files are only registers, some include registers blocks among other material. This patch introduces data structures and functions to deal with both cases. I expect more users of this over time. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/debugfs.h')
-rw-r--r--include/linux/debugfs.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index e7d9b20ddc5b..5e6b01f6db4c 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -16,6 +16,7 @@
16#define _DEBUGFS_H_ 16#define _DEBUGFS_H_
17 17
18#include <linux/fs.h> 18#include <linux/fs.h>
19#include <linux/seq_file.h>
19 20
20#include <linux/types.h> 21#include <linux/types.h>
21 22
@@ -26,6 +27,17 @@ struct debugfs_blob_wrapper {
26 unsigned long size; 27 unsigned long size;
27}; 28};
28 29
30struct debugfs_reg32 {
31 char *name;
32 unsigned long offset;
33};
34
35struct debugfs_regset32 {
36 struct debugfs_reg32 *regs;
37 int nregs;
38 void __iomem *base;
39};
40
29extern struct dentry *arch_debugfs_dir; 41extern struct dentry *arch_debugfs_dir;
30 42
31#if defined(CONFIG_DEBUG_FS) 43#if defined(CONFIG_DEBUG_FS)
@@ -74,6 +86,13 @@ struct dentry *debugfs_create_blob(const char *name, mode_t mode,
74 struct dentry *parent, 86 struct dentry *parent,
75 struct debugfs_blob_wrapper *blob); 87 struct debugfs_blob_wrapper *blob);
76 88
89struct dentry *debugfs_create_regset32(const char *name, mode_t mode,
90 struct dentry *parent,
91 struct debugfs_regset32 *regset);
92
93int debugfs_print_regs32(struct seq_file *s, struct debugfs_reg32 *regs,
94 int nregs, void __iomem *base, char *prefix);
95
77bool debugfs_initialized(void); 96bool debugfs_initialized(void);
78 97
79#else 98#else
@@ -188,6 +207,13 @@ static inline struct dentry *debugfs_create_blob(const char *name, mode_t mode,
188 return ERR_PTR(-ENODEV); 207 return ERR_PTR(-ENODEV);
189} 208}
190 209
210static inline struct dentry *debugfs_create_regset32(const char *name,
211 mode_t mode, struct dentry *parent,
212 struct debugfs_regset32 *regset)
213{
214 return ERR_PTR(-ENODEV);
215}
216
191static inline bool debugfs_initialized(void) 217static inline bool debugfs_initialized(void)
192{ 218{
193 return false; 219 return false;