summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuanjiang Yu <yuanjiang.yu@unisoc.com>2019-07-31 06:00:24 -0400
committerSebastian Reichel <sebastian.reichel@collabora.com>2019-09-02 16:47:09 -0400
commit168e68d072756d631a210342d0429c969501b7cf (patch)
tree674baebc9b57b1145722e076943383b6cc64dcf4
parent7cff19b9a8ff1fdc61655dad4e2009bb44099d70 (diff)
power: supply: sc27xx: Fix conditon to enable the FGU interrupt
We should allow to enable FGU interrupt to adjust the battery capacity, when charging status is POWER_SUPPLY_STATUS_DISCHARGING. Signed-off-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-rw-r--r--drivers/power/supply/sc27xx_fuel_gauge.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
index 1072fcdfe8b2..db7d07d5dae9 100644
--- a/drivers/power/supply/sc27xx_fuel_gauge.c
+++ b/drivers/power/supply/sc27xx_fuel_gauge.c
@@ -1098,7 +1098,8 @@ static int sc27xx_fgu_suspend(struct device *dev)
1098 * If we are charging, then no need to enable the FGU interrupts to 1098 * If we are charging, then no need to enable the FGU interrupts to
1099 * adjust the battery capacity. 1099 * adjust the battery capacity.
1100 */ 1100 */
1101 if (status != POWER_SUPPLY_STATUS_NOT_CHARGING) 1101 if (status != POWER_SUPPLY_STATUS_NOT_CHARGING &&
1102 status != POWER_SUPPLY_STATUS_DISCHARGING)
1102 return 0; 1103 return 0;
1103 1104
1104 ret = regmap_update_bits(data->regmap, data->base + SC27XX_FGU_INT_EN, 1105 ret = regmap_update_bits(data->regmap, data->base + SC27XX_FGU_INT_EN,