summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2021-06-04 15:08:05 -0700
committerCommit Bot <commit-bot@chromium.org>2021-06-05 03:55:54 +0000
commitf2f46e879f5cc9a3197caefb1616918baa5ece21 (patch)
treec5c7feaaad27112fc1428077a37cb9380823200a
parent383a0afdbc88313160251f074c7bca013c0e1ae5 (diff)
downloadchrome-ec-f2f46e879f5cc9a3197caefb1616918baa5ece21.tar.gz
zephyr: Add config to enable resume-init/suspend-complete hooks
Add the new PLATFORM_EC_CHIPSET_RESUME_INIT_HOOK option to Zephyr Kconfig. BRANCH=None BUG=b:190224781, b:183054226 TEST=Pending test. The following CL enables the option. Change-Id: I98b8c19fa53ef59ca58a8aafd4bde00dc8e8ed58 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941805 Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--zephyr/Kconfig9
-rw-r--r--zephyr/shim/include/config_chip.h5
2 files changed, 14 insertions, 0 deletions
diff --git a/zephyr/Kconfig b/zephyr/Kconfig
index 3e6114e518..0953a9b1b2 100644
--- a/zephyr/Kconfig
+++ b/zephyr/Kconfig
@@ -182,6 +182,15 @@ config PLATFORM_EC_CHIPSET_RESET_HOOK
Then do_something() will be called just before the reset happens.
+config PLATFORM_EC_CHIPSET_RESUME_INIT_HOOK
+ bool "Enable chipset resume-init and suspend-complete hooks"
+ help
+ Enables support for the HOOK_CHIPSET_RESUME_INIT and
+ HOOK_CHIPSET_SUSPEND_COMPLETE hooks. These hooks are usually used to
+ initialize/disable 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.
+
config PLATFORM_EC_CONSOLE_CMD_HCDEBUG
bool "Console command: hcdebug"
default y
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 8f3406bb05..204f3732c9 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -236,6 +236,11 @@
#define CONFIG_CHIPSET_RESET_HOOK
#endif
+#undef CONFIG_CHIPSET_RESUME_INIT_HOOK
+#ifdef CONFIG_PLATFORM_EC_CHIPSET_RESUME_INIT_HOOK
+#define CONFIG_CHIPSET_RESUME_INIT_HOOK
+#endif
+
#ifdef CONFIG_PLATFORM_EC_EXTPOWER_GPIO
#define CONFIG_EXTPOWER_GPIO