diff options
author | Denis Brockus <dbrockus@google.com> | 2020-10-30 10:56:35 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-30 22:01:40 +0000 |
commit | affd2a81b625986a1fbafa6407eb2d85c7dd48a6 (patch) | |
tree | b31a2e3de59a9d6479cb0d771cc218d1c9e6707f | |
parent | 40c29ee74d2f581c93c75ba3077718481981859f (diff) | |
download | chrome-ec-affd2a81b625986a1fbafa6407eb2d85c7dd48a6.tar.gz |
TCPMv2: Hard Reset to only disable ADD if Vbus drops
If the sourcing partner does not leave Safe5V on
Hard Reset then AutoDischargeDisconnect should not
be disabled.
BUG=b:170325888
BRANCH=zork
TEST=SuzyQ should work
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: Ie191b0529b1f33bdaca09643b5a44af034935539
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2509977
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
-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; |