From c7a2cb72c6de063c83cc2b5385f1e67571267569 Mon Sep 17 00:00:00 2001 From: Wai-Hong Tam Date: Thu, 23 Jul 2020 16:34:35 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2321875 --- common/hooks.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common/hooks.c') 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}, -- cgit v1.2.1