summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2021-06-03 13:35:26 -0700
committerCommit Bot <commit-bot@chromium.org>2021-06-04 02:01:38 +0000
commit41e6fa81e0b5ce9db307d6684452add25f7ac1ef (patch)
tree17effb36b7a5606e82858fa72cc4326eed66f497 /common
parent273bdad8ef38e581895111556e1432bdf3201716 (diff)
downloadchrome-ec-41e6fa81e0b5ce9db307d6684452add25f7ac1ef.tar.gz
chgstv2: Call board_check_extpower on AC change
Some boards don't have an interrupt which indicate that extpower is present or not. In some cases, the EC may miss an edge if the call comes to early to check whether AC is ok. However, the charger task periodically polls this state. This commit has the charger task call `board_check_extpower` when it notices that the AC presence has changed. This can ultimately end up triggering the HOOK_AC_CHANGE hook. BUG=b:189911786 BRANCH=dedede TEST=Build and flash boten, plug in charger, suspend DUT, unplug DUT, verify that DUT wakes up even after the first call to check AC OK occurs. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Id0b60289cfb14509fd781942afbcedfa9e127a8a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2937738 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/charge_state_v2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index 2b856ffe6b..67a9f5d79b 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -1778,6 +1778,11 @@ void charger_task(void *u)
board_base_reset();
#endif
if (curr.ac != prev_ac) {
+ /*
+ * We've noticed a change in AC presence, let the board
+ * know.
+ */
+ board_check_extpower();
if (curr.ac) {
/*
* Some chargers are unpowered when the AC is