From 601fbbbc44194f2a76e15e68fabd908d8fa79e1a Mon Sep 17 00:00:00 2001 From: Diana Z Date: Fri, 13 Aug 2021 23:04:17 -0600 Subject: 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 Change-Id: I808ff5b89c112437b595b391d455c9c22ca10194 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095440 Reviewed-by: Abe Levkoy --- driver/usb_mux/virtual.c | 12 +++--------- 1 file 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; } -- cgit v1.2.1