aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-10-03 07:40:47 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-10-14 20:59:59 -0400
commitd058bb49618482f2eff0db57618c9a7352916dd5 (patch)
treeb7b4a88a8f3bcceb14856ba09ddfa5e81e8f8b39
parent061adc064adbbdd9eb127ab2e86b7a71f4ccaf2e (diff)
regmap: Allow ranges to be named
For more useful diagnostics. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/base/regmap/internal.h1
-rw-r--r--drivers/base/regmap/regmap.c1
-rw-r--r--include/linux/regmap.h4
3 files changed, 6 insertions, 0 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index 80f9ab9c3aa4..27e66c3e7a59 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -120,6 +120,7 @@ int _regmap_write(struct regmap *map, unsigned int reg,
120 120
121struct regmap_range_node { 121struct regmap_range_node {
122 struct rb_node node; 122 struct rb_node node;
123 const char *name;
123 124
124 unsigned int range_min; 125 unsigned int range_min;
125 unsigned int range_max; 126 unsigned int range_max;
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 0544f63ecd31..ce5129df4406 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -579,6 +579,7 @@ struct regmap *regmap_init(struct device *dev,
579 goto err_range; 579 goto err_range;
580 } 580 }
581 581
582 new->name = range_cfg->name;
582 new->range_min = range_cfg->range_min; 583 new->range_min = range_cfg->range_min;
583 new->range_max = range_cfg->range_max; 584 new->range_max = range_cfg->range_max;
584 new->selector_reg = range_cfg->selector_reg; 585 new->selector_reg = range_cfg->selector_reg;
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index afc8e1a2cd1b..9f228d7f7ac4 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -142,6 +142,8 @@ struct regmap_config {
142 * 1. page selector register update; 142 * 1. page selector register update;
143 * 2. access through data window registers. 143 * 2. access through data window registers.
144 * 144 *
145 * @name: Descriptive name for diagnostics
146 *
145 * @range_min: Address of the lowest register address in virtual range. 147 * @range_min: Address of the lowest register address in virtual range.
146 * @range_max: Address of the highest register in virtual range. 148 * @range_max: Address of the highest register in virtual range.
147 * 149 *
@@ -153,6 +155,8 @@ struct regmap_config {
153 * @window_len: Number of registers in data window. 155 * @window_len: Number of registers in data window.
154 */ 156 */
155struct regmap_range_cfg { 157struct regmap_range_cfg {
158 const char *name;
159
156 /* Registers of virtual address range */ 160 /* Registers of virtual address range */
157 unsigned int range_min; 161 unsigned int range_min;
158 unsigned int range_max; 162 unsigned int range_max;