mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
zoombini: Initialize Vbus suppliers.
In order for charge manager to be fully seeded, we need to initialize all the Vbus suppliers. Additionally, remove the hack for C0 since the TCPCs can detect Vbus now. BUG=None BRANCH=None TEST=Flash zoombini; Verify that charge manager is seeded. Change-Id: I086f70ea26a3f804815017a5f492bd624b85ffd0 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/677874 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
61a6a3814f
commit
bd73291223
@@ -182,10 +182,25 @@ DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT);
|
||||
|
||||
static void board_init(void)
|
||||
{
|
||||
struct charge_port_info chg;
|
||||
int i;
|
||||
|
||||
/* Enable TCPC interrupts. */
|
||||
gpio_enable_interrupt(GPIO_USB_C0_PD_INT_L);
|
||||
gpio_enable_interrupt(GPIO_USB_C1_PD_INT_L);
|
||||
gpio_enable_interrupt(GPIO_USB_C2_PD_INT_L);
|
||||
|
||||
/* Initialize VBUS suppliers. */
|
||||
for (i = 0; i < CONFIG_USB_PD_PORT_COUNT; i++) {
|
||||
if (tcpm_get_vbus_level(i)) {
|
||||
chg.voltage = 5000;
|
||||
chg.current = USB_CHARGER_MIN_CURR_MA;
|
||||
} else {
|
||||
chg.voltage = 0;
|
||||
chg.current = 0;
|
||||
}
|
||||
charge_manager_update_charge(CHARGE_SUPPLIER_VBUS, i, &chg);
|
||||
}
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user