summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2023-04-10 15:20:35 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-10 10:16:24 +0000
commit5afa300f8f2066970719167af4d68aca50fc03c0 (patch)
treefb3a9290173986cc81519cbbc3d5694bb3a72ee2
parent2398ea805370730e25c8ea95adf088d3b9684fa8 (diff)
downloadchrome-ec-5afa300f8f2066970719167af4d68aca50fc03c0.tar.gz
geralt: fix initial base state
Geralt's base_detect_tick() and base_update() assumes that `base-attached` implies `!TABLET_TRIGGER_BASE`, which is not true during static global initialization. Fix this by forcing base detached at init. BUG=b:273687730 TEST=`ectool mkbpget switches` reports reasonable state before first base state change. BRANCH=none LOW_COVERAGE_REASON=early development Change-Id: I68b22bee8f273348f4f75a83c80deaebfaa80933 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4411755 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--zephyr/program/geralt/src/base_detect.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/zephyr/program/geralt/src/base_detect.c b/zephyr/program/geralt/src/base_detect.c
index 074c2db5f9..feb01337ce 100644
--- a/zephyr/program/geralt/src/base_detect.c
+++ b/zephyr/program/geralt/src/base_detect.c
@@ -91,6 +91,8 @@ static int base_init(const struct device *unused)
{
static struct ap_power_ev_callback cb;
+ base_update(false);
+
ap_power_ev_init_callback(&cb, base_startup_hook,
AP_POWER_STARTUP | AP_POWER_SHUTDOWN);
ap_power_ev_add_callback(&cb);