summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrover Yen <Grover_Yen@wistron.com>2015-11-10 14:14:10 +0800
committerChromeOS bot <3su6n15k.default@developer.gserviceaccount.com>2015-11-19 02:00:14 +0000
commitc5cc9c9c812096fa2c667118deb846e01178ce51 (patch)
tree3988702d026f29c630739c712902008a79797e7f
parent09e2c7b1c3058ab7f5616a9fbc919ba8786362dd (diff)
downloadchrome-ec-c5cc9c9c812096fa2c667118deb846e01178ce51.tar.gz
buddy: EC support hibernation with extpower
Support hibernation with extpower when board is charger-less. BUG=chrome-os-partner:47272 BRANCH=none TEST=EC entering hibernation after system shutdown 1 hour with extpower. Change-Id: Icdec9164a20068d341988d2d17bbf562eaca8e11 Signed-off-by: Grover Yen <Grover_Yen@wistron.com> Reviewed-on: https://chromium-review.googlesource.com/312672 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--power/common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/power/common.c b/power/common.c
index 96c6966900..76756c7312 100644
--- a/power/common.c
+++ b/power/common.c
@@ -143,9 +143,12 @@ static enum power_state power_common_state(enum power_state state)
in_want = 0;
#ifdef CONFIG_HIBERNATE
+#ifdef CONFIG_CHARGER
if (extpower_is_present())
task_wait_event(-1);
- else {
+ else
+#endif
+ {
uint64_t target_time = last_shutdown_time +
hibernate_delay * 1000000ull;
uint64_t time_now = get_time().val;