diff options
author | Tim Lin <tim2.lin@ite.corp-partner.google.com> | 2021-12-28 11:27:09 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-06 00:58:55 +0000 |
commit | 9620d669a2b18bc54ac412a3d69445e19708cf4e (patch) | |
tree | c8c63fb7b22c49f3877e2967ffd5d74693ef5df0 /zephyr | |
parent | 09bae4c492e295086cc19b699331025931a2f83d (diff) | |
download | chrome-ec-9620d669a2b18bc54ac412a3d69445e19708cf4e.tar.gz |
zephyr: cleanup: remove interval of allow low power idle
The interval related to allow low power idle has been moved to
drivers/uart, so remove it here.
BUG=b:192354255
BRANCH=none
TEST=Test on hayato. After entering deep doze, it has to take 15s
to enter again.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Change-Id: I0ad9a414408a5a8fe43a7c71089076374039f34c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3359156
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r-- | zephyr/shim/chip/it8xxx2/power_policy.c | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/zephyr/shim/chip/it8xxx2/power_policy.c b/zephyr/shim/chip/it8xxx2/power_policy.c index 92613710fe..62e2a14ab8 100644 --- a/zephyr/shim/chip/it8xxx2/power_policy.c +++ b/zephyr/shim/chip/it8xxx2/power_policy.c @@ -9,42 +9,17 @@ #include <zephyr.h> #include "system.h" -#include "timer.h" static const struct pm_state_info pm_states[] = PM_STATE_INFO_LIST_FROM_DT_CPU(DT_NODELABEL(cpu0)); -#define CONSOLE_IN_USE_ON_BOOT_TIME (5 * SECOND) -#define CONSOLE_IN_USE_TIMEOUT_SEC (5 * SECOND) - -static timestamp_t console_expire_time; -static timestamp_t sleep_mode_t0; - -void uart1_wui_isr_late(void) -{ - /* Set console in use expire time. */ - console_expire_time = get_time(); - console_expire_time.val += CONSOLE_IN_USE_TIMEOUT_SEC; -} - -static int clock_allow_low_power_idle(void) -{ - sleep_mode_t0 = get_time(); - - /* If we are waked up by console, then keep awake at least 5s. */ - if (sleep_mode_t0.val < console_expire_time.val) - return 0; - - return 1; -} - /* CROS PM policy handler */ struct pm_state_info pm_policy_next_state(uint8_t cpu, int32_t ticks) { ARG_UNUSED(cpu); - /* Deep sleep is allowed and an interval of five seconds. */ - if (DEEP_SLEEP_ALLOWED && clock_allow_low_power_idle()) { + /* Deep sleep is allowed */ + if (DEEP_SLEEP_ALLOWED) { /* * If there are multiple power states, iterating backward * is needed to take priority into account. @@ -64,13 +39,3 @@ struct pm_state_info pm_policy_next_state(uint8_t cpu, int32_t ticks) return (struct pm_state_info){PM_STATE_ACTIVE, 0, 0}; } - -static int power_policy_init(const struct device *arg) -{ - ARG_UNUSED(arg); - - console_expire_time.val = get_time().val + CONSOLE_IN_USE_ON_BOOT_TIME; - - return 0; -} -SYS_INIT(power_policy_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); |