summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-08-13 23:04:17 -0600
committerCommit Bot <commit-bot@chromium.org>2021-12-01 00:36:12 +0000
commit601fbbbc44194f2a76e15e68fabd908d8fa79e1a (patch)
tree58bc3cd626b7da92de40b7aed7d9e96ceb90dc78
parenteebfdd14859dbeaa464c9bdcfa6b6c67a5289353 (diff)
downloadchrome-ec-601fbbbc44194f2a76e15e68fabd908d8fa79e1a.tar.gz
Virtual mux: Always wait for ACK
Now that the USB mux task has been introduced, the virtual mux can always wait on an ACK without blocking the PD tasks. BRANCH=None BUG=b:186777984 TEST=pass tast typec.Mode*.manual on voxel Cq-Depend: chromium:3295572 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I808ff5b89c112437b595b391d455c9c22ca10194 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095440 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--driver/usb_mux/virtual.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/driver/usb_mux/virtual.c b/driver/usb_mux/virtual.c
index 4388bb485a..0ca6c2a8d9 100644
--- a/driver/usb_mux/virtual.c
+++ b/driver/usb_mux/virtual.c
@@ -55,16 +55,10 @@ static inline void virtual_mux_update_state(int port, mux_state_t mux_state,
* TCSS Mux to allow better synchronization between them and thereby
* remain in the same state for achieving proper safe state
* terminations.
+ *
+ * Note the AP will only ACK if the mux state changed in some way.
*/
-
- /* 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)) ||
- ((previous_mux_state != USB_PD_MUX_NONE) &&
- (mux_state == USB_PD_MUX_NONE)))
+ if (previous_mux_state != mux_state)
*ack_required = true;
}