aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/internal.h
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-10 11:24:29 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-10 11:29:47 -0500
commit5166b7c006eeb4f6becc0822974d8da259484ba1 (patch)
treeb28c4098a5b75a34efd8262efcc99fdf8d586365 /drivers/base/regmap/internal.h
parentafab2f7b21b042bcbffb1e82f78243382a122d70 (diff)
regmap: debugfs: Cache offsets of valid regions for dump
Avoid doing a linear scan of the entire register map for each read() of the debugfs register dump by recording the offsets where valid registers exist when we first read the registers file. This assumes the set of valid registers never changes, if this is not the case invalidation of the cache will be required. This could be further improved for large blocks of contiguous registers by calculating the register we will read from within the block - currently we do a linear scan of the block. An rbtree may also be worthwhile. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap/internal.h')
-rw-r--r--drivers/base/regmap/internal.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index 1abcd27e2d0f..9c3b0e7a6c7d 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -15,10 +15,18 @@
15 15
16#include <linux/regmap.h> 16#include <linux/regmap.h>
17#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/list.h>
18 19
19struct regmap; 20struct regmap;
20struct regcache_ops; 21struct regcache_ops;
21 22
23struct regmap_debugfs_off_cache {
24 struct list_head list;
25 off_t min;
26 off_t max;
27 unsigned int base_reg;
28};
29
22struct regmap_format { 30struct regmap_format {
23 size_t buf_size; 31 size_t buf_size;
24 size_t reg_bytes; 32 size_t reg_bytes;
@@ -54,6 +62,8 @@ struct regmap {
54 unsigned int debugfs_reg_len; 62 unsigned int debugfs_reg_len;
55 unsigned int debugfs_val_len; 63 unsigned int debugfs_val_len;
56 unsigned int debugfs_tot_len; 64 unsigned int debugfs_tot_len;
65
66 struct list_head debugfs_off_cache;
57#endif 67#endif
58 68
59 unsigned int max_register; 69 unsigned int max_register;