mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
power: qpnp-fg-gen4: Fix maintenance SOC reporting logic
Some times the SOC value reported as increasing even though there is no charger connected to the device. Fix it by correcting maintenance SOC reporting logic. Change-Id: I0fb897616c72467f68b9be9a193c28a9008765ea Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
This commit is contained in:
parent
5e27b9d63f
commit
9b0f88c231
@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
@ -2641,14 +2641,14 @@ static int fg_gen4_update_maint_soc(struct fg_dev *fg)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (msoc > fg->maint_soc) {
|
||||
if (msoc >= fg->maint_soc) {
|
||||
/*
|
||||
* When the monotonic SOC goes above maintenance SOC, we should
|
||||
* stop showing the maintenance SOC.
|
||||
*/
|
||||
fg->delta_soc = 0;
|
||||
fg->maint_soc = 0;
|
||||
} else if (fg->maint_soc && msoc <= fg->last_msoc) {
|
||||
} else if (fg->maint_soc && msoc < fg->last_msoc) {
|
||||
/* MSOC is decreasing. Decrease maintenance SOC as well */
|
||||
fg->maint_soc -= 1;
|
||||
if (!(msoc % 10)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user