mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-12 10:55:21 +00:00
usb_charger: Always update VBUS charge supplier
usb_charger_init() did not call charge_manager_update_charge() if we are sourcing VBUS. This means we can get stuck with charge_manager_is_seeded() never returning true, and so charging never starts, and power-on is prevented. Change update_vbus_supplier() so it always calls charge_manager_update_charge(), but with current = 0 when we are sourcing VBUS. BUG=b:80203727 BRANCH=none TEST=Reboot Grunt EC while one USB-C port is VBUS source. Change-Id: I24c29dc6b9ad9c50254181614a6440d2d055cd5a Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1086113 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
This commit is contained in:
@@ -27,17 +27,14 @@ static void update_vbus_supplier(int port, int vbus_level)
|
||||
{
|
||||
struct charge_port_info charge;
|
||||
|
||||
/*
|
||||
* If VBUS is low, or VBUS is high and we are not outputting VBUS
|
||||
* ourselves, then update the VBUS supplier.
|
||||
*/
|
||||
if (!vbus_level || !usb_charger_port_is_sourcing_vbus(port)) {
|
||||
charge.voltage = USB_CHARGER_VOLTAGE_MV;
|
||||
charge.current = vbus_level ? USB_CHARGER_MIN_CURR_MA : 0;
|
||||
charge_manager_update_charge(CHARGE_SUPPLIER_VBUS,
|
||||
port,
|
||||
&charge);
|
||||
}
|
||||
charge.voltage = USB_CHARGER_VOLTAGE_MV;
|
||||
|
||||
if (vbus_level && !usb_charger_port_is_sourcing_vbus(port))
|
||||
charge.current = USB_CHARGER_MIN_CURR_MA;
|
||||
else
|
||||
charge.current = 0;
|
||||
|
||||
charge_manager_update_charge(CHARGE_SUPPLIER_VBUS, port, &charge);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USB_PD_5V_EN_CUSTOM
|
||||
|
||||
Reference in New Issue
Block a user