summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Mooney <charliemooney@chromium.org>2012-08-02 16:18:12 -0700
committerCharlie Mooney <charliemooney@chromium.org>2012-08-03 09:52:22 -0700
commit5e996478c9b41396771b97b0e2228d23f070ab45 (patch)
tree2ff08de14bd268a1ec7b8f20aac0ea7752f95efd
parent29d478c92b2e90f36b5d7d76974bce1af99c4811 (diff)
downloadchrome-ec-5e996478c9b41396771b97b0e2228d23f070ab45.tar.gz
Fixing lid power behavior -- shutdowns vs reboots
When the user is logged in a closes/opens the lid of the laptop the lid_changed flag gets set, but never cleared. Normally, it would get cleared when it powered back on from being opened, but without powerm running or is the machine is only suspended, then that never happens. This fixes the problem by additionally clearing the flag whenever the computer is powered down. This forces the computer to not turn on based on anything that happened to its lid before it was turned off, which is the behavior you'd expect. BUG=chrome-os-partner:12189 TEST=Log in to your Chomebook completely. Close, then open the lid. Shut the computer down. It should stay off now. Once it's back on close the lid and confirm that it still suspends correctly. Now open the lid and make sure it turns back on. Repeat these steps, but kill powerm first. Change-Id: I2275b3125115b4eacc6a5d074978d7a1d51b0695 Signed-off-by: Charlie Mooney <charliemooney@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/29111 Reviewed-by: Benson Leung <bleung@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/gaia_power.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/gaia_power.c b/common/gaia_power.c
index 2cc872ab03..3082f4afea 100644
--- a/common/gaia_power.c
+++ b/common/gaia_power.c
@@ -420,6 +420,7 @@ static void power_off(void)
gpio_set_level(GPIO_PMIC_PWRON_L, 1);
gpio_set_level(GPIO_EN_PP5000, 0);
ap_on = 0;
+ lid_changed = 0;
powerled_set_state(POWERLED_STATE_OFF);
CPUTS("Shutdown complete.\n");
}