diff options
author | Keith Short <keithshort@chromium.org> | 2021-04-24 14:26:16 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-29 18:34:01 +0000 |
commit | 13a437909f984da73327a8e4ce6ed8adb0ccdce6 (patch) | |
tree | 2091a3e14d33ae6bf9bc390f7cb450304ff7fbc4 /zephyr/drivers | |
parent | 85ea1cd0acb35b141d9f5deef26ff96e32d87365 (diff) | |
download | chrome-ec-13a437909f984da73327a8e4ce6ed8adb0ccdce6.tar.gz |
zephyr: npcx: Add power management support
Add power management support for the NPCX family.
BUG=b:184653704
BRANCH=none
TEST=zmake testall
TEST=Verify deep sleep on Volteer (with next CL) and measure power.
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I86eef50c13742e7ca717da38a92636e589af6c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2855527
Reviewed-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Diffstat (limited to 'zephyr/drivers')
-rw-r--r-- | zephyr/drivers/cros_system/cros_system_npcx.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/zephyr/drivers/cros_system/cros_system_npcx.c b/zephyr/drivers/cros_system/cros_system_npcx.c index d814a8967f..c5b8e1a2f8 100644 --- a/zephyr/drivers/cros_system/cros_system_npcx.c +++ b/zephyr/drivers/cros_system/cros_system_npcx.c @@ -515,6 +515,12 @@ static int cros_system_npcx_hibernate(const struct device *dev, return 0; } +__maybe_unused static uint64_t +cros_system_npcx_deep_sleep_ticks(const struct device *dev) +{ + return npcx_clock_get_sleep_ticks(); +} + static struct cros_system_npcx_data cros_system_npcx_dev_data; static const struct cros_system_npcx_config cros_system_dev_cfg = { @@ -531,6 +537,9 @@ static const struct cros_system_driver_api cros_system_driver_npcx_api = { .chip_vendor = cros_system_npcx_get_chip_vendor, .chip_name = cros_system_npcx_get_chip_name, .chip_revision = cros_system_npcx_get_chip_revision, +#ifdef CONFIG_SOC_POWER_MANAGEMENT_TRACE + .deep_sleep_ticks = cros_system_npcx_deep_sleep_ticks, +#endif }; DEVICE_DEFINE(cros_system_npcx_0, "CROS_SYSTEM", cros_system_npcx_init, NULL, |