diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-04-21 14:23:40 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-22 00:51:55 +0000 |
commit | df7f8588fbb829b6b71966e2400c2dc2180f08ee (patch) | |
tree | ce2fde31e0d0e965faecb52b9b4d0b65790c030f | |
parent | a3541ae7d490b84a38aa9079a1644509961dc6e0 (diff) | |
download | chrome-ec-df7f8588fbb829b6b71966e2400c2dc2180f08ee.tar.gz |
Trogdor: Add a delay to ensure the power-off sequence complete
The existing power-off sequence waits for one of the rails (L10A)
drop and then turns off the switchcap. The L10A rail is in the
middle of the power-off sequence. The entire sequence may not
complete yet.
This CL adds a delay to ensure the sequence complete.
Qualcomm measured the entire POFF duration is around 70ms. Setting
this delay to 70ms is more than enough.
BRANCH=None
BUG=b:154537026, b:148478165
TEST=Triggered power off and on multiple time.
TEST=Toggled warm_reset multiple time.
Change-Id: I10bce33ba39c8ed6269c040f934e7b7dd2422d7e
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2159925
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
-rw-r--r-- | power/sc7180.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/power/sc7180.c b/power/sc7180.c index 0d2412b095..d1e8aeee42 100644 --- a/power/sc7180.c +++ b/power/sc7180.c @@ -91,6 +91,14 @@ */ #define SYSTEM_POWER_ON_DELAY (110 * MSEC) +/* + * Delay between the PMIC power drop and power-off the system. + * Qualcomm measured the entire POFF duration is around 70ms. Setting + * this delay to 70ms is more than enough, as the PMIC power drop is in + * the middle of POFF duration. + */ +#define PMIC_POWER_OFF_DELAY (70 * MSEC) + /* TODO(crosbug.com/p/25047): move to HOOK_POWER_BUTTON_CHANGE */ /* 1 if the power button was pressed last time we checked */ static char power_button_was_pressed; @@ -468,6 +476,7 @@ static void power_off(void) /* Do a graceful way to shutdown PMIC/AP first */ set_pmic_pwron(0); + usleep(PMIC_POWER_OFF_DELAY); /* Disable signal interrupts, as they are floating when switchcap off */ power_signal_disable_interrupt(GPIO_AP_RST_L); |