Skip to content

Commit

Permalink
power: supply: sc27xx: Fix conditon to enable the FGU interrupt
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yuanjiang Yu authored and Sebastian Reichel committed Sep 2, 2019
1 parent 7cff19b commit 168e68d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/power/supply/sc27xx_fuel_gauge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,8 @@ static int sc27xx_fgu_suspend(struct device *dev)
* If we are charging, then no need to enable the FGU interrupts to
* adjust the battery capacity.
*/
if (status != POWER_SUPPLY_STATUS_NOT_CHARGING)
if (status != POWER_SUPPLY_STATUS_NOT_CHARGING &&
status != POWER_SUPPLY_STATUS_DISCHARGING)
return 0;

ret = regmap_update_bits(data->regmap, data->base + SC27XX_FGU_INT_EN,
Expand Down

0 comments on commit 168e68d

Please sign in to comment.