diff options
-rw-r--r-- | common/usbc/usb_tc_drp_acc_trysrc_sm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c index c25ad19fad..4785aa9b91 100644 --- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c +++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c @@ -1232,9 +1232,6 @@ static bool tc_perform_snk_hard_reset(int port) { switch (tc[port].ps_reset_state) { case PS_STATE0: - /* Shutting off power, Disable AutoDischargeDisconnect */ - tcpm_enable_auto_discharge_disconnect(port, 0); - /* Hard reset sets us back to default data role */ tc_set_data_role(port, PD_ROLE_UFP); @@ -1259,6 +1256,10 @@ static bool tc_perform_snk_hard_reset(int port) if (get_time().val < tc[port].timeout) return false; + /* Power shut off? Disable AutoDischargeDisconnect */ + if (!pd_is_vbus_present(port)) + tcpm_enable_auto_discharge_disconnect(port, 0); + /* Watch for Vbus to return */ tc[port].ps_reset_state = PS_STATE2; tc[port].timeout = get_time().val + PD_T_SRC_TURN_ON; |