diff options
author | Chris Zhong <zyw@rock-chips.com> | 2014-09-26 10:08:19 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-02 20:51:02 +0000 |
commit | 7a8891268daed617ad55198618ea2486a291fcdd (patch) | |
tree | 50ff86446ad7ecd2bf3183e2049ae2e852f702cf | |
parent | cac05af1aa5b033f350cd497791ab70f8da30974 (diff) | |
download | chrome-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>
-rw-r--r-- | board/veyron/gpio.inc | 1 | ||||
-rw-r--r-- | power/rockchip.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/board/veyron/gpio.inc b/board/veyron/gpio.inc index 37c91c80f7..e38ac5aea7 100644 --- a/board/veyron/gpio.inc +++ b/board/veyron/gpio.inc @@ -27,6 +27,7 @@ GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) GPIO(WP_L, B, 4, GPIO_INPUT, NULL) /* Outputs */ +GPIO(5V_DRV, A, 8, GPIO_OUT_LOW, NULL) GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW, NULL) GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW, NULL) GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW, NULL) 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 */ |