summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-04-09 13:40:24 -0600
committerSimone Willett <swillett@nvidia.com>2012-04-15 14:58:10 -0700
commit48f282fdd1833460e1ee5fc1a9e3008fcede3b38 (patch)
treebc231eac1da3530e915a173c3d67847252adc81f /include
parentaf3575e322c4ae602e90ca006fac8ce00d46d2cc (diff)
regmap: implement register striding
regmap_config.reg_stride is introduced. All extant register addresses are a multiple of this value. Users of serial-oriented regmap busses will typically set this to 1. Users of the MMIO regmap bus will typically set this based on the value size of their registers, in bytes, so 4 for a 32-bit register. Throughout the regmap code, actual register addresses are used. Wherever the register address is used to index some array of values, the address is divided by the stride to determine the index, or vice-versa. Error- checking is added to all entry-points for register address data to ensure that register addresses actually satisfy the specified stride. The MMIO bus ensures that the specified stride is large enough for the register size. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> (cherry picked from commit f01ee60fffa4dc6c77122121233a793f7f696e67) Change-Id: I634977dcb0fe9ff95c7932e9195a2c1918eb1c18 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/96510 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/regmap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index bb732fe260cf..6986d16aeca8 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -47,6 +47,9 @@ struct reg_default {
* register regions.
*
* @reg_bits: Number of bits in a register address, mandatory.
+ * @reg_stride: The register address stride. Valid register addresses are a
+ * multiple of this value. If set to 0, a value of 1 will be
+ * used.
* @pad_bits: Number of bits of padding between register and value.
* @val_bits: Number of bits in a register value, mandatory.
*
@@ -80,6 +83,7 @@ struct regmap_config {
const char *name;
int reg_bits;
+ int reg_stride;
int pad_bits;
int val_bits;