summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorTommy Chung <tommy.chung@quanta.corp-partner.google.com>2022-06-30 16:07:46 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-01 07:53:48 +0000
commit373f3daa4e5e44c3350393b4b4995e7cc10f2312 (patch)
treefbc54adb2e0cbe01037d2f43643b2a4bbe3e5643 /power
parent9a4edfa2caf0356d2a84b07371015f89c52db41f (diff)
downloadchrome-ec-373f3daa4e5e44c3350393b4b4995e7cc10f2312.tar.gz
power/mt8192: Do not exit hard off when ap idle
To prevent system power on from POWER_G3 when ap idle (such as power off the system in recovery mode), set exit_hard_off to 0 for this condition. BUG=b:237230874 BRANCH=cherry TEST=make sure that system will not power on when power off in recovery mode. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I27697a030f3fdb128ea87b559add0a4a05399c56 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3737702 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/mt8192.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/power/mt8192.c b/power/mt8192.c
index fc99bce5e0..c977d6f617 100644
--- a/power/mt8192.c
+++ b/power/mt8192.c
@@ -204,6 +204,7 @@ DECLARE_HOOK(HOOK_CHIPSET_RESET, handle_chipset_reset, HOOK_PRIO_FIRST);
enum power_state power_chipset_init(void)
{
int exit_hard_off = 1;
+ uint32_t reset_flags = system_get_reset_flags();
/* Enable reboot / sleep control inputs from AP */
gpio_enable_interrupt(GPIO_AP_EC_WARM_RST_REQ);
@@ -216,9 +217,10 @@ enum power_state power_chipset_init(void)
CPRINTS("already in S0");
return POWER_S0;
}
- } else if (system_get_reset_flags() & EC_RESET_FLAG_AP_OFF) {
+ } else if ((reset_flags & EC_RESET_FLAG_AP_OFF) ||
+ (reset_flags & EC_RESET_FLAG_AP_IDLE)) {
exit_hard_off = 0;
- } else if ((system_get_reset_flags() & EC_RESET_FLAG_HIBERNATE) &&
+ } else if ((reset_flags & EC_RESET_FLAG_HIBERNATE) &&
gpio_get_level(GPIO_AC_PRESENT)) {
/*
* If AC present, assume this is a wake-up by AC insert.