Veyron: cancel the long press timer when lost power_good

if power good is lost and the power button still press, we need cancel the long
press timer, otherwise EC will crash.

BUG=chrome-os-partner:34816
TEST=press power button during coreboot, and it can shutdown normally
BRANCH=None

Change-Id: Ia27c83137451abacce9d544741bbbe5787983215
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/237294
Reviewed-by: Jiazi Yang <Tomato_Yang@asus.com>
Reviewed-by: Alexandru Stan <amstan@chromium.org>
Commit-Queue: Eddie Cai <eddie.cai8848@gmail.com>
This commit is contained in:
Chris Zhong
2014-12-24 04:47:01 -08:00
committed by chrome-internal-fetch
parent ff91ba5bb1
commit 8bd44bf4d5

View File

@@ -170,6 +170,7 @@ static int check_for_power_off_event(void)
{
timestamp_t now;
int pressed = 0;
int ret = 0;
/*
* Check for power button press.
@@ -206,13 +207,16 @@ static int check_for_power_off_event(void)
timer_cancel(TASK_ID_CHIPSET);
}
/* POWER_GOOD released by AP : shutdown immediately */
if (!power_has_signals(IN_POWER_GOOD)) {
if (power_button_was_pressed)
timer_cancel(TASK_ID_CHIPSET);
ret = 3;
}
power_button_was_pressed = pressed;
/* POWER_GOOD released by AP : shutdown immediately */
if (!power_has_signals(IN_POWER_GOOD))
return 3;
return 0;
return ret;
}
static void rockchip_lid_event(void)