summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2017-03-22 11:31:56 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-03-23 10:05:11 -0700
commit7db12fdc3ec824e28554b96edb5e08fcdeb658cf (patch)
tree5c0f8c6cd22bc3b72627dcb92c289e969893c107
parentd2fd876fa5046a10766c9d3a6943600b762be736 (diff)
downloadchrome-ec-7db12fdc3ec824e28554b96edb5e08fcdeb658cf.tar.gz
eve: Fix corner case for trackpad wake
If we go to sleep with a lid close event, the trackpad is immediately waking the system. Since we don't want to accidentally wake if the trackpad got input while the lid is closed anyway this change will disable trackpad wake when the lid is closed. BUG=b:35587072 BRANCH=none TEST=manual testing on Eve P1b: 1) enter suspend by closing lid and ensure it stays in suspend 2) enter suspend by idle, and then close the lid, and ensure it stays suspended Change-Id: Ied73dde61e99231f057504ca56c473432aa30e4b Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/457865 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
-rw-r--r--board/eve/board.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/board/eve/board.c b/board/eve/board.c
index 7b83c05659..7493ea249b 100644
--- a/board/eve/board.c
+++ b/board/eve/board.c
@@ -616,7 +616,7 @@ DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT);
/* Called on AP S0 -> S3 transition */
static void board_chipset_suspend(void)
{
- if (!tablet_get_mode())
+ if (!tablet_get_mode() && lid_is_open())
trackpad_wake_enable(1);
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
@@ -628,6 +628,14 @@ static void board_chipset_resume(void)
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
+/* Called on lid change */
+static void board_lid_change(void)
+{
+ if (!lid_is_open())
+ trackpad_wake_enable(0);
+}
+DECLARE_HOOK(HOOK_LID_CHANGE, board_lid_change, HOOK_PRIO_DEFAULT);
+
void board_hibernate_late(void)
{
int i;