summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Yung-Chieh Lo <yjlou@chromium.org>2014-05-07 14:58:58 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-05-09 02:49:44 +0000
commit315631c871c3977b9f109081410f9a6651d55298 (patch)
tree511b695ea5672786a9acf60944afb8c8cc147f89
parentda5b8fa6c79807a8ea69258f43f60f742fb9246d (diff)
downloadchrome-ec-315631c871c3977b9f109081410f9a6651d55298.tar.gz
tegra: fix bug that apshutdown cannot shut down the AP.
The power_request variable is not clear in apshutdown case. Thus, the AP comes up again by the "power up" request. Clear this variable only when apshutdown command to avoid affecting the regular power states. BUG=chrome-os-partner:28621 BRANCH=tot,nyan TEST=see below > reboot // or other methods to turn on the AP. > power on > apshutdown // The AP should remain off. Change-Id: Icfc8a50db95aba656168f5b10dabd9443d75338d Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/198770 Reviewed-by: David Hendricks <dhendrix@chromium.org>
-rw-r--r--power/tegra.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/power/tegra.c b/power/tegra.c
index b263980662..fe549f41db 100644
--- a/power/tegra.c
+++ b/power/tegra.c
@@ -111,6 +111,11 @@ enum power_request_t {
static enum power_request_t power_request;
+
+/* Forward declaration */
+static void chipset_turn_off_power_rails(void);
+
+
/**
* Set the AP RESET signal.
*
@@ -232,7 +237,7 @@ enum power_state power_chipset_init(void)
*/
if (!(system_get_reset_flags() & RESET_FLAG_SYSJUMP)) {
CPRINTF("[%T not sysjump; forcing AP shutdown]\n");
- chipset_force_shutdown();
+ chipset_turn_off_power_rails();
/*
* The warm reset triggers AP into the Tegra recovery mode (
@@ -254,7 +259,7 @@ enum power_state power_chipset_init(void)
/*****************************************************************************/
/* Chipset interface */
-void chipset_force_shutdown(void)
+static void chipset_turn_off_power_rails(void)
{
/* Release the power button, if it was asserted */
set_pmic_pwron(0);
@@ -268,6 +273,14 @@ void chipset_force_shutdown(void)
set_ap_reset(1);
}
+void chipset_force_shutdown(void)
+{
+ chipset_turn_off_power_rails();
+
+ /* clean-up internal variable */
+ power_request = POWER_REQ_NONE;
+}
+
/*****************************************************************************/
/**
@@ -403,7 +416,7 @@ static void power_off(void)
/* Call hooks before we drop power rails */
hook_notify(HOOK_CHIPSET_SHUTDOWN);
/* switch off all rails */
- chipset_force_shutdown();
+ chipset_turn_off_power_rails();
/* Change SUSPEND_L pin to high-Z to reduce power draw. */
gpio_set_flags(GPIO_SUSPEND_L, GPIO_INPUT);