diff options
author | Aseda Aboagye <aaboagye@google.com> | 2018-05-16 21:02:08 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-17 07:23:08 -0700 |
commit | 8c891f0d32954471b7f437d0282eecc0c088c84a (patch) | |
tree | 7abd7dcd2e83d21b3b43a1987af661b8d6d31b14 | |
parent | 781f3eca1fa78eb03f6411d0f742343507f201bc (diff) | |
download | chrome-ec-8c891f0d32954471b7f437d0282eecc0c088c84a.tar.gz |
nocturne: Power base on startup if attached.
This commit fixes a bug where the base would not be powered after the
system was power cycled without disconnecting the base.
BUG=none
BRANCH=poppy
TEST=Flash nocturne; boot to S0, attach base, shutdown to S5. Boot to
S0, verify that base is powered.
Change-Id: Ia3de500afdc29cb601c1b5571cd3355711a3b368
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1062993
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r-- | board/nocturne/base_detect.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/board/nocturne/base_detect.c b/board/nocturne/base_detect.c index 8e3ac022e0..188d9fecd0 100644 --- a/board/nocturne/base_detect.c +++ b/board/nocturne/base_detect.c @@ -211,11 +211,17 @@ static void base_detect_deferred(void) }; DECLARE_HOOK(HOOK_INIT, base_detect_deferred, HOOK_PRIO_INIT_ADC + 1); -static void power_on_base(void) +static void restart_state_machine(void) { + /* + * Since we do not poll in S5, the base may or may not be connected, + * therefore intentionally set the state to detached such that we can + * detect and power on the base if necessary. + */ + set_state(BASE_DETACHED); hook_call_deferred(&base_detect_deferred_data, 0); } -DECLARE_HOOK(HOOK_CHIPSET_STARTUP, power_on_base, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_CHIPSET_STARTUP, restart_state_machine, HOOK_PRIO_DEFAULT); static void power_off_base(void) { |