summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/ab8500_fg.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2022-01-29 01:49:16 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2022-02-11 20:24:53 +0100
commitd662a7df36e1edc65eaf166ec1c8527ce9d088ea (patch)
treebbb46e0c8ad140ef166d7704081662de78e3227f /drivers/power/supply/ab8500_fg.c
parentpower: supply: ab8500: Drop BATCTRL thermal mode (diff)
downloadlinux-d662a7df36e1edc65eaf166ec1c8527ce9d088ea.tar.xz
linux-d662a7df36e1edc65eaf166ec1c8527ce9d088ea.zip
power: supply: ab8500: Swap max and overvoltage
We should terminate charging when we reach the voltage_max_design_uv not overvoltage_limit_uv, this is an abuse of that struct member. The overvoltage limit is actually not configurable on the AB8500, it is fixed to 4.75 V so drop a comment about that in the code. Fixes: 2a5f41830aad ("power: supply: ab8500: Standardize voltages") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply/ab8500_fg.c')
-rw-r--r--drivers/power/supply/ab8500_fg.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c
index b0919a6a6587..236fd9f9d6f1 100644
--- a/drivers/power/supply/ab8500_fg.c
+++ b/drivers/power/supply/ab8500_fg.c
@@ -2263,7 +2263,13 @@ static int ab8500_fg_init_hw_registers(struct ab8500_fg *di)
{
int ret;
- /* Set VBAT OVV threshold */
+ /*
+ * Set VBAT OVV (overvoltage) threshold to 4.75V (typ) this is what
+ * the hardware supports, nothing else can be configured in hardware.
+ * See this as an "outer limit" where the charger will certainly
+ * shut down. Other (lower) overvoltage levels need to be implemented
+ * in software.
+ */
ret = abx500_mask_and_set_register_interruptible(di->dev,
AB8500_CHARGER,
AB8500_BATT_OVV,