diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-07-23 16:34:35 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-30 04:32:32 +0000 |
commit | c7a2cb72c6de063c83cc2b5385f1e67571267569 (patch) | |
tree | 45760db3175a93b561cf8cb275649cad30f86c62 /common/hooks.c | |
parent | b40786b4b8f543e8e33537582ca0b5b71f57b1f1 (diff) | |
download | chrome-ec-c7a2cb72c6de063c83cc2b5385f1e67571267569.tar.gz |
hooks: Introduce chipset resume init and suspend complete hooks
These hooks are only enabled through a new CONFIG.
The resume init hook will be used to initialize the SPI driver,
which goes to sleep on suspend. Require to initialize
it first such that it can receive a host resume event, that
notifies the normal resume hook.
The suspend complete hook is paired with the resume init hook,
which reverts the initialization of the SPI driver.
BRANCH=None
BUG=b:148149387
TEST=make buildall -j
TEST=Build successfully on both default off and defining this CONFIG.
Change-Id: I615e2bf92c75f83a7b0ab3eded61a1ef241dbdcf
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2321875
Diffstat (limited to 'common/hooks.c')
-rw-r--r-- | common/hooks.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/hooks.c b/common/hooks.c index 8c8e8b09fe..4c2a4e48c6 100644 --- a/common/hooks.c +++ b/common/hooks.c @@ -40,6 +40,11 @@ static const struct hook_ptrs hook_list[] = { {__hooks_chipset_startup, __hooks_chipset_startup_end}, {__hooks_chipset_resume, __hooks_chipset_resume_end}, {__hooks_chipset_suspend, __hooks_chipset_suspend_end}, +#ifdef CONFIG_CHIPSET_RESUME_INIT_HOOK + {__hooks_chipset_resume_init, __hooks_chipset_resume_init_end}, + {__hooks_chipset_suspend_complete, + __hooks_chipset_suspend_complete_end}, +#endif {__hooks_chipset_shutdown, __hooks_chipset_shutdown_end}, {__hooks_chipset_shutdown_complete, __hooks_chipset_shutdown_complete_end}, |