Skip to content

Commit

Permalink
regmap: add helper macro to set min/max range of register
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Laxman Dewangan authored and Mark Brown committed Sep 20, 2013
1 parent 272b98c commit 6112fe6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/regmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6112fe6

Please sign in to comment.