build/patch/kernel/archive/sunxi-6.5/patches.megous/power-supply-axp20x_battery-Fix-charging-done-detection.patch

42 lines
1.3 KiB
Diff
Raw Normal View History

From 534257b7dbbfbdcf45f928219be34bfc5922f020 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 29 Feb 2020 00:55:09 -0600
Subject: [PATCH 226/464] power: supply: axp20x_battery: Fix charging done
detection
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/power/supply/axp20x_battery.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c
index 1ca11e93f984..6b51005d8551 100644
--- a/drivers/power/supply/axp20x_battery.c
+++ b/drivers/power/supply/axp20x_battery.c
@@ -34,6 +34,7 @@
#define AXP20X_PWR_STATUS_BAT_CHARGING BIT(2)
+#define AXP20X_PWR_OP_BATT_CHARGING BIT(6)
#define AXP20X_PWR_OP_BATT_PRESENT BIT(5)
#define AXP20X_PWR_OP_BATT_ACTIVATED BIT(3)
@@ -219,12 +220,12 @@ static int axp20x_battery_get_prop(struct power_supply *psy,
break;
case POWER_SUPPLY_PROP_STATUS:
- ret = regmap_read(axp20x_batt->regmap, AXP20X_PWR_INPUT_STATUS,
+ ret = regmap_read(axp20x_batt->regmap, AXP20X_PWR_OP_MODE,
&reg);
if (ret)
return ret;
- if (reg & AXP20X_PWR_STATUS_BAT_CHARGING) {
+ if (reg & AXP20X_PWR_OP_BATT_CHARGING) {
val->intval = POWER_SUPPLY_STATUS_CHARGING;
return 0;
}
--
2.34.1