summaryrefslogtreecommitdiff
path: root/common/ocpc.c
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-10-16 15:09:06 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-03 00:11:47 +0000
commit8abe7e21cb7d8b943b3d0e3174e39e748b4499a5 (patch)
treebe90f5c9ee6ab4419565971a92d910b6b92c60a3 /common/ocpc.c
parent7c9baa4c0774075386981124b9a8dc8c3b8ce4c7 (diff)
downloadchrome-ec-8abe7e21cb7d8b943b3d0e3174e39e748b4499a5.tar.gz
OCPC: Calculate resistance in suspend
Currently our resistance calculations are only made when the system is charging in S5 or lower. We can perform these calculations when the system is in suspend as well since the power consumption is low. Additionally, it's very possible that a user may not charge in G3 for a very long time if at all. BUG=b:170975872 BRANCH=None TEST=Build and flash waddledoo, suspend DUT, charge from sub board, verify that resistance is being calculated. Change-Id: I882eae0014f5c7986e5997872f4a9e004f82ee9d Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2508851 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/ocpc.c')
-rw-r--r--common/ocpc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/ocpc.c b/common/ocpc.c
index 75876457c4..647092a8ca 100644
--- a/common/ocpc.c
+++ b/common/ocpc.c
@@ -215,7 +215,8 @@ int ocpc_config_secondary_charger(int *desired_input_current,
* If the system is in S5/G3, we can calculate the board and battery
* resistances.
*/
- if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) {
+ if (chipset_in_state(CHIPSET_STATE_ANY_OFF |
+ CHIPSET_STATE_ANY_SUSPEND)) {
/*
* In the first few iterations of the loop, charging isn't
* stable/correct so making the calculation then leads to some