summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-10-13 09:45:47 -0700
committerCommit Bot <commit-bot@chromium.org>2020-10-14 00:22:51 +0000
commit307b4d213ead0184f13bb4f1c3cd1824aefb9548 (patch)
tree3f228790e52989d965307395caea94e3369fca71 /power
parent061d6259110a0b8d913015d9579dcb50f5de5800 (diff)
downloadchrome-ec-307b4d213ead0184f13bb4f1c3cd1824aefb9548.tar.gz
sc7180: Notify SUSPEND hooks in S0S3 if shutdown from on
This CL pairs with the previous CL:2391202, which notifies the RESUME hook in S3S0 if boot from off. This CL does the counter part, which notifies the SUSPEND hooks in S0S3 if shutdown from on. BRANCH=None BUG=b:148149387, b:170604357 TEST=Verified the SUSPEND hooks are called when shutdown from S0. For example, all the PWM channels are disabled after power off AP. Change-Id: Ib420d5d0e560f30f9c03b5e31788a145279a9c75 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2468476 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/sc7180.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/power/sc7180.c b/power/sc7180.c
index f80703f740..212e47fe8b 100644
--- a/power/sc7180.c
+++ b/power/sc7180.c
@@ -1033,10 +1033,15 @@ enum power_state power_handle_state(enum power_state state)
#ifdef CONFIG_CHIPSET_RESUME_INIT_HOOK
/*
* Pair with the HOOK_CHIPSET_RESUME_INIT, i.e. disabling SPI
- * driver, by notifying the SUSPEND_COMPLETE hook. The normal
- * SUSPEND hook will be notified afterward.
+ * driver, by notifying the SUSPEND_COMPLETE hooks.
+ *
+ * If shutdown from an on state, notify the SUSPEND hooks too;
+ * otherwise (suspend from S0), the normal SUSPEND hooks will
+ * be notified afterward.
*/
hook_notify(HOOK_CHIPSET_SUSPEND_COMPLETE);
+ if (shutdown_from_on)
+ hook_notify(HOOK_CHIPSET_SUSPEND);
#else
hook_notify(HOOK_CHIPSET_SUSPEND);
#endif