summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-07-21 09:56:40 -0600
committerCommit Bot <commit-bot@chromium.org>2021-08-14 06:06:39 +0000
commitab1cdf1648d390619848f4f4f901b14aeee75244 (patch)
tree74b814ec98390eabb46c4a012adbc501c70e9df2 /include
parent80b43435ca89510e985481b725a470566fb65a05 (diff)
downloadchrome-ec-ab1cdf1648d390619848f4f4f901b14aeee75244.tar.gz
USB MUX: Generalize mux ACK
Currently, only the virtual mux driver uses the mux ACK feature, but the actual wait for the host command ACK is a part of the usb_mux general code. Generalize this mux ACK wait so it's available if needed in the future for more muxes. Additionally, moving this wait out of the mux set will allow us to lock the muxes intelligently between tasks, without keeping the muxes locked during the inactive ACK wait. BRANCH=None BUG=b:172222942,b:186777984 TEST=tast typec.Mode*.manual on voxel Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I61a043425a482cc6f3170548c888d91ec20c2a82 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3078411 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/driver/tcpm/tcpci.h3
-rw-r--r--include/usb_mux.h9
2 files changed, 8 insertions, 4 deletions
diff --git a/include/driver/tcpm/tcpci.h b/include/driver/tcpm/tcpci.h
index 669236bcb0..04002862df 100644
--- a/include/driver/tcpm/tcpci.h
+++ b/include/driver/tcpm/tcpci.h
@@ -282,7 +282,8 @@ void tcpci_tcpc_enable_auto_discharge_disconnect(int port, int enable);
int tcpci_tcpc_debug_accessory(int port, bool enable);
int tcpci_tcpm_mux_init(const struct usb_mux *me);
-int tcpci_tcpm_mux_set(const struct usb_mux *me, mux_state_t mux_state);
+int tcpci_tcpm_mux_set(const struct usb_mux *me, mux_state_t mux_state,
+ bool *ack_required);
int tcpci_tcpm_mux_get(const struct usb_mux *me, mux_state_t *mux_state);
int tcpci_tcpm_mux_enter_low_power(const struct usb_mux *me);
int tcpci_get_chip_info(int port, int live,
diff --git a/include/usb_mux.h b/include/usb_mux.h
index 61a2c5167b..548ee8940b 100644
--- a/include/usb_mux.h
+++ b/include/usb_mux.h
@@ -42,11 +42,14 @@ struct usb_mux_driver {
/**
* Set USB mux state.
*
- * @param me usb_mux
- * @param mux_state State to set mux to.
+ * @param[in] me usb_mux
+ * @param[in] mux_state State to set mux to.
+ * @param[out] bool ack_required - indication of whether this mux needs
+ * to wait on a host command ACK at the end of a set
* @return EC_SUCCESS on success, non-zero error code on failure.
*/
- int (*set)(const struct usb_mux *me, mux_state_t mux_state);
+ int (*set)(const struct usb_mux *me, mux_state_t mux_state,
+ bool *ack_required);
/**
* Get current state of USB mux.