diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2019-03-08 10:38:03 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-28 19:04:16 -0700 |
commit | a029c7a27f3bd1a1066db9c167c6166688fe4ef3 (patch) | |
tree | c619eee562bbc8af7cddeda7b602e41a8b086ded /include/chipset.h | |
parent | 9c7428ea97fb6606979607457a86a1ebf8ec9b19 (diff) | |
download | chrome-ec-a029c7a27f3bd1a1066db9c167c6166688fe4ef3.tar.gz |
power: Allow board to take custom action on G3 timer expiration
This patch introduces board_system_is_idle callback function. It's
called when system is in G3. A board can customize its action taken
when system is idle in G3 using battery thresholds, expiration timer,
etc. determined at runtime.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=none
BRANCH=nami,strago,coral
TEST=Verify Vayne cut off battery on G3 idle expiration while other
Nami's hibernate.
Change-Id: I6118a074ac7d844b99d9c0f3eb638b72d5894008
Reviewed-on: https://chromium-review.googlesource.com/1512623
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include/chipset.h')
-rw-r--r-- | include/chipset.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/chipset.h b/include/chipset.h index 77695c8303..2cf21277cb 100644 --- a/include/chipset.h +++ b/include/chipset.h @@ -104,6 +104,12 @@ enum chipset_shutdown_reason { CHIPSET_SHUTDOWN_COUNT, }; +enum critical_shutdown { + CRITICAL_SHUTDOWN_IGNORE, + CRITICAL_SHUTDOWN_HIBERNATE, + CRITICAL_SHUTDOWN_CUTOFF, +}; + #ifdef HAS_TASK_CHIPSET /** @@ -232,6 +238,17 @@ void chipset_warm_reset_interrupt(enum gpio_signal signal); */ void chipset_watchdog_interrupt(enum gpio_signal signal); +/** + * Callback which allows board to take custom action on G3 timer expiration + * + * @param last_shutdown_time Last shutdown time + * @param target Expiration time. Can be modified by board. + * @param now Current time + * @return Action to take + */ +enum critical_shutdown board_system_is_idle(uint64_t last_shutdown_time, + uint64_t *target, uint64_t now); + #ifdef CONFIG_CMD_AP_RESET_LOG /** |