From 5641bbfe3bd7c776b35320730be681e6b5626748 Mon Sep 17 00:00:00 2001 From: Alexandru M Stan Date: Wed, 20 Aug 2014 10:18:22 -0700 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/213249 Reviewed-by: Yung-chieh Lo --- power/rockchip.c | 6 ++++-- 1 file 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",