diff options
author | Rob Barnes <robbarnes@google.com> | 2022-03-16 06:20:15 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-03-17 20:28:54 +0000 |
commit | 4412c9404d6e28e168ed2a4856d6d678707c8967 (patch) | |
tree | 730e26a7d6c0b37ce2f9494a47eb21986c069493 /power/mt8183.c | |
parent | c24772c046ec72364e61e694694dca7865de0570 (diff) | |
download | chrome-ec-4412c9404d6e28e168ed2a4856d6d678707c8967.tar.gz |
power: Add chipset and board callbacks for sleep hangs
Instead of passing a callback to host_sleep, define overridable board
and chipset callbacks for sleep hang detection.
Introduce a sleep_hang_type enum that identifies the type of sleep hang
(suspend or resume).
These changes make it eaier for boards to implement custom logic to
handle sleep hangs.
BUG=b:218892808
BRANCH=guybrush
TEST=Observe suspend hang detection on Nipperkin with KI
Change-Id: Ifacf90f808b1447633f7cfc2d570209d1e233950
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3529606
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'power/mt8183.c')
-rw-r--r-- | power/mt8183.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/power/mt8183.c b/power/mt8183.c index 7c747541a6..f62ddafb51 100644 --- a/power/mt8183.c +++ b/power/mt8183.c @@ -581,7 +581,8 @@ enum power_state power_handle_state(enum power_state state) } #ifdef CONFIG_POWER_TRACK_HOST_SLEEP_STATE -static void suspend_hang_detected(void) +__override void power_chipset_handle_sleep_hang( + enum sleep_hang_type hang_type) { CPRINTS("Warning: Detected sleep hang! Waking host up!"); host_set_single_event(EC_HOST_EVENT_HANG_DETECT); @@ -600,7 +601,7 @@ __override void power_chipset_handle_host_sleep_event( * notification needs to be sent to listeners. */ sleep_set_notify(SLEEP_NOTIFY_SUSPEND); - sleep_start_suspend(ctx, suspend_hang_detected); + sleep_start_suspend(ctx); } else if (state == HOST_SLEEP_EVENT_S3_RESUME) { /* |