summaryrefslogtreecommitdiff
path: root/include/usb_mux.h
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-04-23 10:42:42 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-04-24 18:53:06 -0700
commit58f790b2c19cc95a07ac72fa4d7df1974619f785 (patch)
tree3d0cc230438a6541bb6b7fd5ea8d6cd52a17e259 /include/usb_mux.h
parentdc875f284fd9c152d337949cf486d8c072c8a9e6 (diff)
downloadchrome-ec-58f790b2c19cc95a07ac72fa4d7df1974619f785.tar.gz
mux: add mode for TCPCI mux that is not the TCPC
We need to use the PS8751 as the USB mux without configuring it as the TCPC. Add mode that allows passing in i2c port and address instead using tcpc_config_t values. BRANCH=none BUG=b:78341944 TEST=build using bip Change-Id: I45b420ef890dfa8c5e5052864b7a2bb66d8734d6 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1024486
Diffstat (limited to 'include/usb_mux.h')
-rw-r--r--include/usb_mux.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/usb_mux.h b/include/usb_mux.h
index 151c397995..71ed1140ae 100644
--- a/include/usb_mux.h
+++ b/include/usb_mux.h
@@ -15,6 +15,11 @@
/* USB-C mux state */
typedef uint8_t mux_state_t;
+/* Packing and Unpacking defines used with CONFIG_USB_PD_TCPM_TCPCI_MUX_ONLY */
+#define MUX_PORT_AND_ADDR(port, addr) ((port << 8) | (addr & 0xFF))
+#define MUX_PORT(port_addr) (port_addr >> 8)
+#define MUX_ADDR(port_addr) (port_addr & 0xFF)
+
/* Mux state attributes */
/* TODO: Directly use USB_PD_MUX_* everywhere and remove these 3 defines */
#define MUX_USB_ENABLED USB_PD_MUX_USB_ENABLED