summaryrefslogtreecommitdiff
path: root/include/usb_mux.h
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-07-26 16:49:28 -0600
committerJett Rink <jettrink@chromium.org>2018-08-09 16:50:10 +0000
commitab6090e0c013519968a85661353c4d635cb78386 (patch)
tree9a73c102c0d836633496a33d72f0646102e6354c /include/usb_mux.h
parent5affd7d824c369684212d62eb03c19a1e866624b (diff)
downloadchrome-ec-ab6090e0c013519968a85661353c4d635cb78386.tar.gz
usbc_mux: Adding low power mode to USB MUX
This is useful when the PS8751 is used solely as a SS MUX and not a TCPC. It will not get the normal low power mode commands from the PD state machine. We need to issue separate low power command and re-initialization for it. This CL is setting up the machinery for the child CL that uses it for bip. BRANCH=none BUG=b:111664205,b:111876407 TEST=verify that lower power mode is issued for bip with CL stack along with the reinitialization when exiting low power mode. Change-Id: Ida09568acf1f353298520f75505f726d95309c57 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1153834
Diffstat (limited to 'include/usb_mux.h')
-rw-r--r--include/usb_mux.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/include/usb_mux.h b/include/usb_mux.h
index 54107771ed..6a01aae3df 100644
--- a/include/usb_mux.h
+++ b/include/usb_mux.h
@@ -43,7 +43,8 @@ enum typec_mux {
/* Mux driver function pointers */
struct usb_mux_driver {
/**
- * Initialize USB mux.
+ * Initialize USB mux. This is called every time the MUX is access after
+ * being put in a fully disconnected state (low power mode).
*
* @param port_addr Port/address driver-defined parameter.
* @return EC_SUCCESS on success, non-zero error code on failure.
@@ -76,13 +77,24 @@ struct usb_mux {
* (for i2c muxes) or a port number (for GPIO 'muxes').
*/
const int port_addr;
+
/* Mux driver */
const struct usb_mux_driver *driver;
/**
- * Board specific initialization for USB mux that is
- * called after mux->driver->init() function and every time the port
- * leaves auto-toggle state.
+ * Optional method that is called after the mux fully disconnects.
+ *
+ * Note: this method does not need to be defined for TCPC/MUX combos
+ * where the TCPC is actively used since the PD state machine
+ * will put the chip into lower power mode.
+ *
+ * @param mux USB mux to put into low power.
+ * @return EC_SUCCESS on success, non-zero error code on failure.
+ */
+ int (*enter_low_power_mode)(const struct usb_mux *mux);
+
+ /**
+ * Optional method for tuning for USB mux during mux->driver->init().
*
* @param mux USB mux to tune
* @return EC_SUCCESS on success, non-zero error code on failure.
@@ -113,7 +125,7 @@ extern struct usb_mux usb_muxes[];
/**
* Initialize USB mux to its default state.
*
- * @param port Port number.
+ * @param port Port number.
*/
void usb_mux_init(int port);