aboutsummaryrefslogtreecommitdiff
path: root/drivers/regulator/rtmv20-regulator.c
diff options
context:
space:
mode:
authorGravatar ChiYuan Huang <cy_huang@richtek.com> 2021-06-01 18:09:15 +0800
committerGravatar Mark Brown <broonie@kernel.org> 2021-06-01 14:03:05 +0100
commit46639a5e684edd0b80ae9dff220f193feb356277 (patch)
treee8b6489abad1f1ec3848644d05bc0a2ea54465b5 /drivers/regulator/rtmv20-regulator.c
parentregulator: mt6315: Fix function prototype for mt6315_map_mode (diff)
downloadlinux-46639a5e684edd0b80ae9dff220f193feb356277.tar.gz
linux-46639a5e684edd0b80ae9dff220f193feb356277.tar.bz2
linux-46639a5e684edd0b80ae9dff220f193feb356277.zip
regulator: rtmv20: Fix to make regcache value first reading back from HW
- Fix to make regcache value first reading back from HW. Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Link: https://lore.kernel.org/r/1622542155-6373-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/rtmv20-regulator.c')
-rw-r--r--drivers/regulator/rtmv20-regulator.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/regulator/rtmv20-regulator.c b/drivers/regulator/rtmv20-regulator.c
index 5adc552dffd5..4bca64de0f67 100644
--- a/drivers/regulator/rtmv20-regulator.c
+++ b/drivers/regulator/rtmv20-regulator.c
@@ -27,6 +27,7 @@
#define RTMV20_REG_LDIRQ 0x30
#define RTMV20_REG_LDSTAT 0x40
#define RTMV20_REG_LDMASK 0x50
+#define RTMV20_MAX_REGS (RTMV20_REG_LDMASK + 1)
#define RTMV20_VID_MASK GENMASK(7, 4)
#define RICHTEK_VID 0x80
@@ -313,6 +314,7 @@ static const struct regmap_config rtmv20_regmap_config = {
.val_bits = 8,
.cache_type = REGCACHE_RBTREE,
.max_register = RTMV20_REG_LDMASK,
+ .num_reg_defaults_raw = RTMV20_MAX_REGS,
.writeable_reg = rtmv20_is_accessible_reg,
.readable_reg = rtmv20_is_accessible_reg,