diff options
author | Aseda Aboagye <aaboagye@google.com> | 2019-07-02 10:53:17 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-07-17 01:53:49 +0000 |
commit | 360e4f98701a0309c35891f3dbea26739127e8f4 (patch) | |
tree | b1d314939daa3427b90659d734f429e5f98f5c23 /common | |
parent | 60d6db8fbf5bae84b94b6dac8ea8c70a08e30555 (diff) | |
download | chrome-ec-360e4f98701a0309c35891f3dbea26739127e8f4.tar.gz |
config: Add CONFIG_MKBP_EVENT_WAKEUP_MASK
This commit adds a new CONFIG_* option, CONFIG_MKBP_EVENT_WAKEUP_MASK.
This allows a board to specify which MKBP events are allowed to wake the
system when it is in suspend.
BUG=b:136282898,chromium:786721
BRANCH=None
TEST=With some other code, flash nocturne, suspend DUT, verify that only
the MKBP events in the CONFIG_MKBP_EVENT_WAKEUP_MASK wake the system up.
Change-Id: Ib4d04418aacab209d0e26703500df119924090b7
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1685785
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/mkbp_event.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/common/mkbp_event.c b/common/mkbp_event.c index 0f59bb15f8..7da6b6044b 100644 --- a/common/mkbp_event.c +++ b/common/mkbp_event.c @@ -136,7 +136,8 @@ static int mkbp_set_host_active(int active, uint32_t *timestamp) #endif } -#ifdef CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK +#if defined(CONFIG_MKBP_EVENT_WAKEUP_MASK) || \ + defined(CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK) /** * Check if the host is sleeping. Check our power state in addition to the * self-reported sleep state of host (CONFIG_POWER_TRACK_HOST_SLEEP_STATE). @@ -148,12 +149,13 @@ static inline int host_is_sleeping(void) #ifdef CONFIG_POWER_TRACK_HOST_SLEEP_STATE enum host_sleep_event sleep_state = power_get_host_sleep_state(); is_sleeping |= - (sleep_state == HOST_SLEEP_EVENT_S3_SUSPEND || + (sleep_state == HOST_SLEEP_EVENT_S0IX_SUSPEND || + sleep_state == HOST_SLEEP_EVENT_S3_SUSPEND || sleep_state == HOST_SLEEP_EVENT_S3_WAKEABLE_SUSPEND); #endif return is_sleeping; } -#endif /* CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK */ +#endif /* CONFIG_MKBP_(HOST_EVENT_)?WAKEUP_MASK */ /* * This is the deferred function that ensures that we attempt to set the MKBP @@ -176,6 +178,13 @@ static void activate_mkbp_with_events(uint32_t events_to_add) CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK); #endif /* CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK */ +#ifdef CONFIG_MKBP_EVENT_WAKEUP_MASK + /* Check to see if this MKBP event should wake the system. */ + if (!skip_interrupt) + skip_interrupt = host_is_sleeping() && + !(events_to_add & CONFIG_MKBP_EVENT_WAKEUP_MASK); +#endif /* CONFIG_MKBP_EVENT_WAKEUP_MASK */ + mutex_lock(&state.lock); state.events |= events_to_add; |