summaryrefslogtreecommitdiff
path: root/include/hooks.h
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-07-23 16:34:35 -0700
committerCommit Bot <commit-bot@chromium.org>2020-07-30 04:32:32 +0000
commitc7a2cb72c6de063c83cc2b5385f1e67571267569 (patch)
tree45760db3175a93b561cf8cb275649cad30f86c62 /include/hooks.h
parentb40786b4b8f543e8e33537582ca0b5b71f57b1f1 (diff)
downloadchrome-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 'include/hooks.h')
-rw-r--r--include/hooks.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/hooks.h b/include/hooks.h
index bc157bacbd..52bca8b94d 100644
--- a/include/hooks.h
+++ b/include/hooks.h
@@ -119,6 +119,24 @@ enum hook_type {
*/
HOOK_CHIPSET_SUSPEND,
+#ifdef CONFIG_CHIPSET_RESUME_INIT_HOOK
+ /*
+ * Initialization before the system resumes, like enabling the SPI
+ * driver such that it can receive a host resume event.
+ *
+ * Hook routines are called from the chipset task.
+ */
+ HOOK_CHIPSET_RESUME_INIT,
+
+ /*
+ * System has suspended. It is paired with CHIPSET_RESUME_INIT hook,
+ * like reverting the initialization of the SPI driver.
+ *
+ * Hook routines are called from the chipset task.
+ */
+ HOOK_CHIPSET_SUSPEND_COMPLETE,
+#endif
+
/*
* System is shutting down. All suspend rails are still on.
*