diff --git a/board/grunt/usb_pd_policy.c b/board/grunt/usb_pd_policy.c index b4184a1da5..ca2545c436 100644 --- a/board/grunt/usb_pd_policy.c +++ b/board/grunt/usb_pd_policy.c @@ -125,8 +125,10 @@ void pd_power_supply_reset(int port) if (prev_en) pd_set_vbus_discharge(port, 1); +#ifdef CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT /* Give back the current quota we are no longer using */ charge_manager_source_port(port, 0); +#endif /* defined(CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT) */ /* Notify host of power info change. */ pd_send_host_event(PD_EVENT_POWER_CHANGE); @@ -141,9 +143,6 @@ int pd_set_power_supply_ready(int port) if (rv) return rv; - /* Ensure we advertise the proper available current quota */ - charge_manager_source_port(port, 1); - pd_set_vbus_discharge(port, 0); /* Provide Vbus. */ @@ -151,6 +150,11 @@ int pd_set_power_supply_ready(int port) if (rv) return rv; +#ifdef CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT + /* Ensure we advertise the proper available current quota */ + charge_manager_source_port(port, 1); +#endif /* defined(CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT) */ + /* Notify host of power info change. */ pd_send_host_event(PD_EVENT_POWER_CHANGE); @@ -164,7 +168,7 @@ void pd_transition_voltage(int idx) void typec_set_source_current_limit(int port, int rp) { - /* TODO(ecgh): call ppc_set_vbus_source_current_limit */ + ppc_set_vbus_source_current_limit(port, rp); } int pd_snk_is_vbus_provided(int port)