diff options
author | Colin Foster <colin.foster@in-advantage.com> | 2022-03-14 01:45:24 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-03-18 19:53:19 +0300 |
commit | 0074f3f2b1e43d3cedd97e47fb6980db6d2ba79e (patch) | |
tree | bc31c30f65706f89a436cb67d8549a46b77db497 /include/linux/regmap.h | |
parent | 86fc59ef818beb0e1945d17f8e734898baba7e4e (diff) | |
download | linux-0074f3f2b1e43d3cedd97e47fb6980db6d2ba79e.tar.xz |
regmap: allow a defined reg_base to be added to every address
There's an inconsistency that arises when a register set can be accessed
internally via MMIO, or externally via SPI. The VSC7514 chip allows both
modes of operation. When internally accessed, the system utilizes __iomem,
devm_ioremap_resource, and devm_regmap_init_mmio.
For SPI it isn't possible to utilize memory-mapped IO. To properly operate,
the resource base must be added to the register before every operation.
Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Link: https://lore.kernel.org/r/20220313224524.399947-3-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.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 40fb9399add6..de81a94d7b30 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -239,6 +239,8 @@ typedef void (*regmap_unlock)(void *); * used. * @reg_downshift: The number of bits to downshift the register before * performing any operations. + * @reg_base: Value to be added to every register address before performing any + * operation. * @pad_bits: Number of bits of padding between register and value. * @val_bits: Number of bits in a register value, mandatory. * @@ -363,6 +365,7 @@ struct regmap_config { int reg_bits; int reg_stride; int reg_downshift; + unsigned int reg_base; int pad_bits; int val_bits; |