DLKM: UI batt level show 100% when real batt level 0%

The unit boot when real batt_soc 0%, the UI batt level show 100%.
The root cause is combine soc is 100 when init, and now
mmi_combine_battery_soc api return soc is -1, so don't update
the combine soc.

Change-Id: I9e41b7f68c735b76c384d1cdcf3ffb6735db4f57
Signed-off-by: mahj8 <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2098253
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
mahj8 2021-10-25 16:24:36 +08:00 • committed by Haijian Ma
commit 54f61e0846

View file

@ -1682,7 +1682,7 @@ static int mmi_combine_battery_soc(struct mmi_charger_chip *chip)
full += battery->info->batt_full_uah;
}
if (full > 0 && remain > 0) {
if (full > 0 && remain >= 0) {
soc = remain / full;
if (soc > 100)
soc = 100;