summaryrefslogtreecommitdiffstats
path: root/include/linux/regmap.h
diff options
context:
space:
mode:
authorColin Foster <colin.foster@in-advantage.com>2022-03-13 15:45:23 -0700
committerMark Brown <broonie@kernel.org>2022-03-18 16:53:18 +0000
commit86fc59ef818beb0e1945d17f8e734898baba7e4e (patch)
treea26c0a85d4df82f4a68c9bfbc3f2529472078311 /include/linux/regmap.h
parent2d2329787ba2e70eae330f1cecd61a9576fe65de (diff)
downloadlinux-stable-86fc59ef818beb0e1945d17f8e734898baba7e4e.tar.gz
linux-stable-86fc59ef818beb0e1945d17f8e734898baba7e4e.tar.bz2
linux-stable-86fc59ef818beb0e1945d17f8e734898baba7e4e.zip
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/regmap.h')
-rw-r--r--include/linux/regmap.h3
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;