summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2014-08-14 22:38:32 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-15 21:13:22 +0000
commit29b18b820ae8f1b26a4698366a0a66747115b743 (patch)
treef3dd0415feaf5e9954a00304a890af1ad388dd80 /power
parent9534a15cd73c674db8a0941793a2f24acb178c7a (diff)
downloadchrome-ec-29b18b820ae8f1b26a4698366a0a66747115b743.tar.gz
tegra: Cancel timer if long power press is canceled
When long power press is canceled, we need to cancel the current running timer. Otherwise, if the power button is pressed again before the current running timer expires, the next deadline won't be set. This causes the chipset task to wake up too early and miss the subsequent long power press shutdown. BUG=chrome-os-partner:31372 TEST=On Ryu, long press following a short press shuts down the system. BRANCH=None Change-Id: I9855b146d430e5babda727fcb429c516ca91e48e Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/212560 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/tegra.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/power/tegra.c b/power/tegra.c
index 592127a668..47364e13c1 100644
--- a/power/tegra.c
+++ b/power/tegra.c
@@ -217,6 +217,9 @@ static int check_for_power_off_event(void)
} else if (power_button_was_pressed) {
CPRINTS("power off cancel");
set_pmic_pwron(0);
+#ifdef CONFIG_PMIC_FW_LONG_PRESS_TIMER
+ timer_cancel(TASK_ID_CHIPSET);
+#endif
}
power_button_was_pressed = pressed;