power: rk3399: Debounce PGOOD_SYS signal

PGOOD_SYS may glitch for a period not to exceed 1ms. When PGOOD_SYS or
PGOOD_AP are deasserted, wait for up to 100ms for both signals return
before transitioning out of S0.

BUG=chrome-os-partner:56822
BRANCH=gru
TEST=Manual on kevin, boot device and verify it remains in S0 without
spurious transitions to S3.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I95ccae54fc5939c835f00dc9b7cf88b9d0553c11
Reviewed-on: https://chromium-review.googlesource.com/393148
Reviewed-by: David Schneider <dnschneid@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
(cherry picked from commit b867d3fc9dea04ac65f5288fb99d3ed65c127644)
Reviewed-on: https://chromium-review.googlesource.com/396139
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Shawn Nematbakhsh
2016-10-04 16:48:17 -07:00
committed by chrome-bot
parent aec1eb35e7
commit d9b7d25b86

View File

@@ -144,9 +144,11 @@ enum power_state power_handle_state(enum power_state state)
/*
* Wait up to PGOOD_AP_DEBOUNCE_TIMEOUT for IN_PGOOD_AP to
* come back before transitioning back to S3.
* come back before transitioning back to S3. PGOOD_SYS can
* also glitch, with a glitch duration < 1ms, so debounce
* it here as well.
*/
if (power_wait_signals_timeout(IN_PGOOD_AP,
if (power_wait_signals_timeout(IN_PGOOD_AP | IN_PGOOD_SYS,
PGOOD_AP_DEBOUNCE_TIMEOUT)
== EC_ERROR_TIMEOUT)
return POWER_S0S3;