regmap: add helper macro to set min/max range of register
authorLaxman Dewangan <ldewangan@nvidia.com>
Fri, 20 Sep 2013 12:30:10 +0000 (18:00 +0530)
committerMark Brown <broonie@linaro.org>
Fri, 20 Sep 2013 16:50:46 +0000 (17:50 +0100)
Add helper macro to set the min and max value of the register range.

This is useful when initialising the register ranges of the device like

static const struct regmap_range readable_ranges[] = {
regmap_reg_range(DEVICE_REG0, DEVICE_REG10),
};

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
include/linux/regmap.h

index a10380bfbeac9b4c4d018c99a5c914d672833f04..7d3ae2be6869ea911db7cb57a308df43ab370b74 100644 (file)
@@ -70,6 +70,8 @@ struct regmap_range {
        unsigned int range_max;
 };
 
+#define regmap_reg_range(low, high) { .range_min = low, .range_max = high, }
+
 /*
  * A table of ranges including some yes ranges and some no ranges.
  * If a register belongs to a no_range, the corresponding check function