summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2014-07-24 14:15:22 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-29 06:43:34 +0000
commitc557f7b7b905f7114feeb1cbea945155b3d54a85 (patch)
treeaf2a57e4bf32036e399b1d5ced81e5861d9b502d /include
parent0e402965fa1c3360c2d69a0149d4c1da2475a5e9 (diff)
downloadchrome-ec-c557f7b7b905f7114feeb1cbea945155b3d54a85.tar.gz
Unify 'typec' console commands in different boards
We have three copies of 'typec' commands in three different boards. The commands current mix hardware-specific logic and console command logic together. Adding a board_get_usb_mux() interface to separate the logic and deduplicate the console command logic. BUG=None TEST=make buildall TEST=Test 'typec' command and verify GPIO settings. BRANCH=None Change-Id: Ie1825f49d32609c732db384679cb917f2f1a4082 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/209955 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h3
-rw-r--r--include/usb_pd.h10
2 files changed, 13 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index cca4f75d30..527e806de7 100644
--- a/include/config.h
+++ b/include/config.h
@@ -921,6 +921,9 @@
/* Dynamic USB PD source capability */
#undef CONFIG_USB_PD_DYNAMIC_SRC_CAP
+/* Support for USB type-c superspeed mux */
+#undef CONFIG_USBC_SS_MUX
+
/*****************************************************************************/
/* Support simple control of power to the device's USB ports */
diff --git a/include/usb_pd.h b/include/usb_pd.h
index deda322db6..2ad76aa3d0 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -257,6 +257,16 @@ enum typec_mux {
*/
void board_set_usb_mux(int port, enum typec_mux mux, int polarity);
+/*
+ * Query superspeed mux status on type-C port.
+ *
+ * @param port port number.
+ * @param dp_str pointer to the DP string to return.
+ * @param usb_str pointer to the USB string to return.
+ * @return Non-zero if superspeed connection is enabled; otherwise, zero.
+ */
+int board_get_usb_mux(int port, const char **dp_str, const char **usb_str);
+
/* --- Physical layer functions : chip specific --- */
/* Packet preparation/retrieval */