Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: axp20x: Mark AXP20X_VBUS_IPSOUT_MGMT as volatile

On AXP288 and newer PMICs, bit 7 of AXP20X_VBUS_IPSOUT_MGMT can be set
to prevent using the VBUS input. However, when the VBUS unplugged and
plugged back in, the bit automatically resets to zero.

We need to set the register as volatile to prevent regmap from caching
that bit. Otherwise, regcache will think the bit is already set and not
write the register.

Fixes: cd53216625a0 ("mfd: axp20x: Fix axp288 volatile ranges")
Cc: stable@vger.kernel.org
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Samuel Holland and committed by
Lee Jones
dc91c3b6 702204c2

+1 -1
+1 -1
drivers/mfd/axp20x.c
··· 126 126 static const struct regmap_range axp288_volatile_ranges[] = { 127 127 regmap_reg_range(AXP20X_PWR_INPUT_STATUS, AXP288_POWER_REASON), 128 128 regmap_reg_range(AXP288_BC_GLOBAL, AXP288_BC_GLOBAL), 129 - regmap_reg_range(AXP288_BC_DET_STAT, AXP288_BC_DET_STAT), 129 + regmap_reg_range(AXP288_BC_DET_STAT, AXP20X_VBUS_IPSOUT_MGMT), 130 130 regmap_reg_range(AXP20X_CHRG_BAK_CTRL, AXP20X_CHRG_BAK_CTRL), 131 131 regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IPSOUT_V_HIGH_L), 132 132 regmap_reg_range(AXP20X_TIMER_CTRL, AXP20X_TIMER_CTRL),