From: Yuanjiang Yu Date: Wed, 31 Jul 2019 10:00:24 +0000 (+0800) Subject: power: supply: sc27xx: Fix conditon to enable the FGU interrupt X-Git-Tag: v5.4-rc1~70^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=168e68d072756d631a210342d0429c969501b7cf;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Baolin Wang Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c index 1072fcd..db7d07d 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) * 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,