diff options
author | Colin Foster | 2022-03-13 15:45:23 -0700 |
---|---|---|
committer | Mark Brown | 2022-03-18 16:53:18 +0000 |
commit | 86fc59ef818beb0e1945d17f8e734898baba7e4e (patch) | |
tree | a26c0a85d4df82f4a68c9bfbc3f2529472078311 /include/linux | |
parent | 2d2329787ba2e70eae330f1cecd61a9576fe65de (diff) |
regmap: add configurable downshift for addresses
Add an additional reg_downshift to be applied to register addresses before
any register accesses. An example of a device that uses this is a VSC7514
chip, which require each register address to be downshifted by two if the
access is performed over a SPI bus.
Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Link: https://lore.kernel.org/r/20220313224524.399947-2-colin.foster@in-advantage.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/regmap.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 22652e5fbc38..40fb9399add6 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -237,6 +237,8 @@ typedef void (*regmap_unlock)(void *); * @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. + * @reg_downshift: The number of bits to downshift the register before + * performing any operations. * @pad_bits: Number of bits of padding between register and value. * @val_bits: Number of bits in a register value, mandatory. * @@ -360,6 +362,7 @@ struct regmap_config { int reg_bits; int reg_stride; + int reg_downshift; int pad_bits; int val_bits; |