mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 10:14:57 +00:00
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>
This commit is contained in:
committed by
chrome-internal-fetch
parent
cac05af1aa
commit
7a8891268d
@@ -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)
|
||||
|
||||
@@ -163,6 +163,17 @@ static void set_pmic_source(int asserted)
|
||||
gpio_set_level(GPIO_PMIC_SOURCE_PWREN, asserted ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user