summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorChris Zhong <zyw@rock-chips.com>2014-09-26 10:08:19 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-02 20:51:02 +0000
commit7a8891268daed617ad55198618ea2486a291fcdd (patch)
tree50ff86446ad7ecd2bf3183e2049ae2e852f702cf /power
parentcac05af1aa5b033f350cd497791ab70f8da30974 (diff)
downloadchrome-ec-7a8891268daed617ad55198618ea2486a291fcdd.tar.gz
Veyron: power on 5v drv for pinky-rev2
EC need to enable 5v_drv when power on AP, disable it when power off AP. BUG=None TEST=USB host works well BRANCH=None Change-Id: Ie18679a5a2d3c676daf0af4da599fa010d98161d Signed-off-by: Chris Zhong <zyw@rock-chips.com> Reviewed-on: https://chromium-review.googlesource.com/220162 Reviewed-by: Alexandru Stan <amstan@chromium.org> Tested-by: Alexandru Stan <amstan@chromium.org> Commit-Queue: Alexandru Stan <amstan@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/rockchip.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/power/rockchip.c b/power/rockchip.c
index 2397ef9d6a..62ec073675 100644
--- a/power/rockchip.c
+++ b/power/rockchip.c
@@ -164,6 +164,17 @@ static void set_pmic_source(int asserted)
}
/**
+ * Power on or off the VCC_5V
+ *
+ * @param asserted Assert (=1) or deassert (=0) the signal.
+ */
+static void set_5v_power(int asserted)
+{
+ /* Signal is active-high */
+ gpio_set_level(GPIO_5V_DRV, asserted ? 1 : 0);
+}
+
+/**
* Check for some event triggering the shutdown.
*
* It can be either a long power button press or a shutdown triggered from the
@@ -400,6 +411,7 @@ static void power_on(void)
/* Call hooks now that AP is running */
hook_notify(HOOK_CHIPSET_STARTUP);
+ set_5v_power(1);
CPRINTS("AP running ...");
}
@@ -439,6 +451,7 @@ static int wait_for_power_button_release(unsigned int timeout_us)
*/
static void power_off(void)
{
+ set_5v_power(0);
/* Call hooks before we drop power rails */
hook_notify(HOOK_CHIPSET_SHUTDOWN);
/* switch off all rails */