summaryrefslogtreecommitdiff
path: root/baseboard/kukui
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2020-07-21 15:35:32 +0800
committerCommit Bot <commit-bot@chromium.org>2020-07-22 10:05:49 +0000
commite19d7f2b47cc62245114ba26da36d753d48714bd (patch)
treefc945fbd00152e2812c80d29c67cddf6cd6bfd3c /baseboard/kukui
parentf06d92218d6c44d8d97ad0600baccc33cb785ff5 (diff)
downloadchrome-ec-e19d7f2b47cc62245114ba26da36d753d48714bd.tar.gz
baseboard/kukui: check stable_current by the timestamp
We should check the stable_current by the timestamp rather than the inited value or not (i.e. CHARGE_CURRENT_UNINITIALIZED). This is because the stable_current might be modified to a previous measured value to let the PDO selection pick the correct PDO by power consumed. e.g. 1. Pick 9V PDO, set stable timestamp expired for 5 mins, rewrite stable_current to CHARGE_CURRENT_UNINITIALIZED 2. At next iteration, if we only check stable_current, we would try to pick a new PDO again, but however, the timestamp is not expired yet. BUG=b:160448099 TEST=ensure kakadu charging won't switch back to 5V immediately after just picking 9V charging BRANCH=kukui Change-Id: I2bfd49a9e8fc5c6d5f4b84eb7da4262d2938f7a6 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2309524 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'baseboard/kukui')
-rw-r--r--baseboard/kukui/charger_mt6370.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/baseboard/kukui/charger_mt6370.c b/baseboard/kukui/charger_mt6370.c
index 49e815c613..5e78a100c5 100644
--- a/baseboard/kukui/charger_mt6370.c
+++ b/baseboard/kukui/charger_mt6370.c
@@ -205,7 +205,7 @@ static void battery_desired_curr_dynamic(struct charge_state_data *curr)
supply_voltage = charge_manager_get_charger_voltage();
stable_current = charge_get_stable_current();
- if (stable_current == CHARGE_CURRENT_UNINITIALIZED)
+ if (!charge_is_current_stable())
return;
if (!prev_supply_voltage)