summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru M Stan <amstan@chromium.org>2014-08-20 10:18:22 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-20 22:39:08 +0000
commit5641bbfe3bd7c776b35320730be681e6b5626748 (patch)
tree248dc79ed3cf81b9a398f372413b113af675355b
parentf7f9783e302a8bc39c24b892b01167f6d8b6edf1 (diff)
downloadchrome-ec-5641bbfe3bd7c776b35320730be681e6b5626748.tar.gz
Veyron: Fix force power-off
I readded the code that armed the power_off_deadline. The force power-off should be controlled fully from the EC now. BUG=None TEST=When in S3/S0, hold the power button for 8 seconds; the system should shutdown. BRANCH=None Change-Id: I848ce6757e497c15296aa4eae9c05133950b4e45 Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/213249 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
-rw-r--r--power/rockchip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/power/rockchip.c b/power/rockchip.c
index 48e2cfce1a..aa0f2f8a78 100644
--- a/power/rockchip.c
+++ b/power/rockchip.c
@@ -50,7 +50,7 @@
#define IN_SUSPEND POWER_SIGNAL_MASK(RK_SUSPEND_ASSERTED)
/* Long power key press to force shutdown */
-#define DELAY_FORCE_SHUTDOWN (10200 * MSEC) /* 10.2 seconds */
+#define DELAY_FORCE_SHUTDOWN (8 * SECOND)
/*
* The minimum time to assert the PMIC PWRON pin is 20ms.
@@ -73,7 +73,7 @@
* into the inner loop, waiting for next event to occur (power button
* press or power good == 0).
*/
-#define DELAY_SHUTDOWN_ON_POWER_HOLD (10200 * MSEC) /* 10.2 seconds */
+#define DELAY_SHUTDOWN_ON_POWER_HOLD (8 * SECOND)
/*
* The hold time for pulling down the PMIC_WARM_RESET_L pin so that
@@ -189,6 +189,8 @@ static int check_for_power_off_event(void)
power_off_deadline.val = now.val + DELAY_FORCE_SHUTDOWN;
CPRINTS("power waiting for long press %u",
power_off_deadline.le.lo);
+ /* Ensure we will wake up to check the power key */
+ timer_arm(power_off_deadline, TASK_ID_CHIPSET);
} else if (timestamp_expired(power_off_deadline, &now)) {
power_off_deadline.val = 0;
CPRINTS("power off after long press now=%u, %u",