diff options
-rw-r--r-- | common/usb_pd_protocol.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index ee7b1585ac..b9722e3cfe 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -1971,20 +1971,22 @@ void pd_task(void) get_time().val + PD_T_SINK_WAIT_CAP, PD_STATE_HARD_RESET_SEND); +#ifdef CONFIG_CHARGE_MANAGER + /* + * If we didn't come from disconnected, must + * have come from some path that did not set + * typec current limit. So, set to 0 so that + * we guarantee this is revised below. + */ + if (pd[port].last_state != + PD_STATE_SNK_DISCONNECTED) + typec_curr = 0; +#endif } #ifdef CONFIG_CHARGE_MANAGER timeout = PD_T_SINK_ADJ - PD_T_DEBOUNCE; - /* - * If we didn't come from disconnected, must have - * come from some path that did not set typec - * current limit. So, set to 0 so that we guarantee - * this is revised below. - */ - if (pd[port].last_state != PD_STATE_SNK_DISCONNECTED) - typec_curr = 0; - /* Check if CC pull-up has changed */ cc1_volt = pd_adc_read(port, pd[port].polarity); if (typec_curr != get_typec_current_limit(cc1_volt)) { |