From 4fd15f8d917719e5f034397c2b92ff318f4b7ee4 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Wed, 24 Jun 2015 13:31:58 -0700 Subject: [PATCH] power: ryu: ignore lid open events Do not start the AP on lid open events, in order to avoid spurious startup due to magnet magic. Signed-off-by: Vincent Palatin BRANCH=smaug BUG=chrome-os-partner:41601 TEST=Play with 2 Ryu EVT2 stacked one on top of the other. Change-Id: I530d54f61d0674caddf20d1b17268c971f639f2f Reviewed-on: https://chromium-review.googlesource.com/281667 Reviewed-by: Alec Berg Commit-Queue: Vincent Palatin Trybot-Ready: Vincent Palatin Tested-by: Vincent Palatin --- board/ryu/board.h | 1 + include/config.h | 3 +++ power/tegra.c | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/board/ryu/board.h b/board/ryu/board.h index 4d7d28c0a5..eb982ed44f 100644 --- a/board/ryu/board.h +++ b/board/ryu/board.h @@ -82,6 +82,7 @@ #define CONFIG_POWER_COMMON #define CONFIG_POWER_BUTTON #define CONFIG_POWER_BUTTON_ACTIVE_STATE 1 +#define CONFIG_POWER_IGNORE_LID_OPEN /* I2C ports configuration */ #define I2C_PORT_MASTER 0 diff --git a/include/config.h b/include/config.h index 46aed17057..208a19957c 100644 --- a/include/config.h +++ b/include/config.h @@ -1059,6 +1059,9 @@ /* Compile common code for AP power state machine */ #undef CONFIG_POWER_COMMON +/* Disable the power-on transition when the lid is opened */ +#undef CONFIG_POWER_IGNORE_LID_OPEN + /* Support stopping in S5 on shutdown */ #undef CONFIG_POWER_SHUTDOWN_PAUSE_IN_S5 diff --git a/power/tegra.c b/power/tegra.c index 5efd41e61d..75c00327fb 100644 --- a/power/tegra.c +++ b/power/tegra.c @@ -231,7 +231,7 @@ static int check_for_power_off_event(void) return 0; } - +#ifndef CONFIG_POWER_IGNORE_LID_OPEN static void tegra_lid_event(void) { /* Power task only cares about lid-open events */ @@ -242,6 +242,7 @@ static void tegra_lid_event(void) task_wake(TASK_ID_CHIPSET); } DECLARE_HOOK(HOOK_LID_CHANGE, tegra_lid_event, HOOK_PRIO_DEFAULT); +#endif /* !CONFIG_POWER_IGNORE_LID_OPEN */ enum power_state power_chipset_init(void) {