summaryrefslogtreecommitdiff
path: root/driver/usb_mux/virtual.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/usb_mux/virtual.c')
-rw-r--r--driver/usb_mux/virtual.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/driver/usb_mux/virtual.c b/driver/usb_mux/virtual.c
index f507078e75..9fbcbd2643 100644
--- a/driver/usb_mux/virtual.c
+++ b/driver/usb_mux/virtual.c
@@ -43,18 +43,24 @@ static inline void virtual_mux_update_state(int port, mux_state_t mux_state)
/*
* EC waits for the ACK from kernel indicating that TCSS Mux
* configuration is completed. This mechanism is implemented for
- * entering and exiting the safe mode. This is needed to remove
- * timing senstivity between BB retimer and TCSS Mux to allow better
- * synchronization between them and thereby remain in the same state
- * for achieving proper safe state terminations.
+ * entering, exiting the safe mode and entering the disconnect mode
+ * This is needed to remove timing senstivity between BB retimer and
+ * TCSS Mux to allow better synchronization between them and thereby
+ * remain in the same state for achieving proper safe state
+ * terminations.
*
* Note: While the EC waits for the ACK, the value of usb_mux_get
* won't match the most recently set value with usb_mux_set.
*/
+
+ /* TODO(b/186777984): Wait for an ACK for all mux state change */
+
if ((!(previous_mux_state & USB_PD_MUX_SAFE_MODE) &&
(mux_state & USB_PD_MUX_SAFE_MODE)) ||
((previous_mux_state & USB_PD_MUX_SAFE_MODE) &&
- !(mux_state & USB_PD_MUX_SAFE_MODE))) {
+ !(mux_state & USB_PD_MUX_SAFE_MODE)) ||
+ ((previous_mux_state != USB_PD_MUX_NONE) &&
+ (mux_state == USB_PD_MUX_NONE))) {
/* This should only be called from the PD task */
assert(port == TASK_ID_TO_PD_PORT(task_get_current()));