diff options
author | Andrew McRae <amcrae@google.com> | 2020-05-29 16:48:00 +1000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-03 04:16:59 +0000 |
commit | 4e1f680a194bbec673f189bcb7add69d642e80d0 (patch) | |
tree | d870d4c03c4d51b45771c9d9f497429ff9656626 | |
parent | b2251706ae8e3850dace9f95156aba906986e2e6 (diff) | |
download | chrome-ec-4e1f680a194bbec673f189bcb7add69d642e80d0.tar.gz |
TCPMv2: CPU wake from suspend should not change alt mode
Handle the CPU wake from suspend by not overriding existing
alt mode settings.
BUG=b:157708283
TEST=Use powerd_dbus_suspend to suspend DUT, check wake-up will work.
BRANCH=none
Signed-off-by: Andrew McRae <amcrae@google.com>
Change-Id: Ia56b57c3a46cb5568ed76c2aa20e7ad48a9b8ea0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2219799
Reviewed-by: Andrew McRae <amcrae@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Andrew McRae <amcrae@chromium.org>
Commit-Queue: Andrew McRae <amcrae@chromium.org>
-rw-r--r-- | common/usbc/usb_tc_drp_acc_trysrc_sm.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c index 042143bf1f..4ead559e68 100644 --- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c +++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c @@ -1408,7 +1408,7 @@ static void handle_new_power_state(int port) if (chipset_in_or_transitioning_to_state( CHIPSET_STATE_ANY_OFF)) { /* - * The SoC will negotiated DP mode again when it + * The SoC will negotiate DP mode again when it * boots up */ pe_exit_dp_mode(port); @@ -1418,18 +1418,6 @@ static void handle_new_power_state(int port) * DP mux, as the chipset is transitioning to OFF. */ set_usb_mux_with_current_data_role(port); - } else if (chipset_in_or_transitioning_to_state( - CHIPSET_STATE_ON)) { - /* - * The following function will restore the USB mux, as - * the chipset is transitioning to ON. - */ - set_usb_mux_with_current_data_role(port); - /* - * Restore the DP mux by entering any previously exited - * alt modes - */ - pe_dpm_request(port, DPM_REQUEST_PORT_DISCOVERY); } } } @@ -3454,10 +3442,19 @@ static void pd_chipset_startup(void) int i; for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) { + set_usb_mux_with_current_data_role(i); pd_set_dual_role_and_event(i, PD_DRP_TOGGLE_OFF, PD_EVENT_UPDATE_DUAL_ROLE | PD_EVENT_POWER_STATE_CHANGE); + /* + * Request port discovery to restore any + * alt modes. + * TODO(b/158042116): Do not start port discovery if there + * is an existing connection. + */ + if (IS_ENABLED(CONFIG_USB_PE_SM)) + pe_dpm_request(i, DPM_REQUEST_PORT_DISCOVERY); } CPRINTS("PD:S5->S3"); |