summaryrefslogtreecommitdiff
path: root/power/tegra.c
diff options
context:
space:
mode:
authorLouis Yung-Chieh Lo <yjlou@chromium.org>2014-02-12 16:37:56 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-03-06 23:14:07 +0000
commit1484116cb0173bce860c4a26aaf5d9625824a401 (patch)
tree22a2d036e2586f7735a83dd7ddba8c15707115e8 /power/tegra.c
parent6bdc69940188cd4f17ecde547afbbc3ad8335367 (diff)
downloadchrome-ec-1484116cb0173bce860c4a26aaf5d9625824a401.tar.gz
stm32l: supports fake-hibernate
We don't have available GPIO pin for power button as the hibernate (stand-by) wake-up source. Also, we don't want to do board change. So, put the EC in a decent infinite loop to pretend the hibernate mode and wait for particular wake-up event. This should be fine because the AP is already down before EC hibernates. BUG=chrome-os-partner:25435 BRANCH=Nyan TEST=see comment #6 of issue for detailed test steps. Change-Id: I2cae131789f9ca5808b60d5f2495222ca9016e7c Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/186061 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'power/tegra.c')
-rw-r--r--power/tegra.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/power/tegra.c b/power/tegra.c
index 021626ee93..4ca3a172f3 100644
--- a/power/tegra.c
+++ b/power/tegra.c
@@ -318,6 +318,10 @@ static void power_on(void)
{
uint64_t t;
+ /* Set pull-up and enable interrupt */
+ gpio_set_flags(GPIO_SUSPEND_L, GPIO_INPUT | GPIO_PULL_UP |
+ GPIO_INT_BOTH);
+
/* Make sure we de-assert the PMI_THERM_L and AP_RESET_L pin. */
set_pmic_therm(0);
set_ap_reset(0);
@@ -390,6 +394,9 @@ static void power_off(void)
/* switch off all rails */
chipset_force_shutdown();
+ /* Change SUSPEND_L pin to high-Z to reduce power draw. */
+ gpio_set_flags(GPIO_SUSPEND_L, GPIO_INPUT);
+
lid_opened = 0;
enable_sleep(SLEEP_MASK_AP_RUN);
powerled_set_state(POWERLED_STATE_OFF);