regmap: Allow ranges to be named
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 3 Oct 2012 11:40:47 +0000 (12:40 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 15 Oct 2012 00:59:59 +0000 (09:59 +0900)
For more useful diagnostics.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/internal.h
drivers/base/regmap/regmap.c
include/linux/regmap.h

index 80f9ab9c3aa4b7eba89b436d0dcd6a96b3623558..27e66c3e7a59abea9ca13a10cc962f458935f57c 100644 (file)
@@ -120,6 +120,7 @@ int _regmap_write(struct regmap *map, unsigned int reg,
 
 struct regmap_range_node {
        struct rb_node node;
+       const char *name;
 
        unsigned int range_min;
        unsigned int range_max;
index 0544f63ecd318b9cbe06b4d9b80f2c533610a9c9..ce5129df4406e16af4f58be87fa85ad77e6ec847 100644 (file)
@@ -579,6 +579,7 @@ struct regmap *regmap_init(struct device *dev,
                        goto err_range;
                }
 
+               new->name = range_cfg->name;
                new->range_min = range_cfg->range_min;
                new->range_max = range_cfg->range_max;
                new->selector_reg = range_cfg->selector_reg;
index afc8e1a2cd1bdcd2fdf5cdfb716d7413b1844f44..9f228d7f7ac48da7e8875a816a73b505686a586c 100644 (file)
@@ -142,6 +142,8 @@ struct regmap_config {
  *     1. page selector register update;
  *     2. access through data window registers.
  *
+ * @name: Descriptive name for diagnostics
+ *
  * @range_min: Address of the lowest register address in virtual range.
  * @range_max: Address of the highest register in virtual range.
  *
@@ -153,6 +155,8 @@ struct regmap_config {
  * @window_len: Number of registers in data window.
  */
 struct regmap_range_cfg {
+       const char *name;
+
        /* Registers of virtual address range */
        unsigned int range_min;
        unsigned int range_max;