summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-06-22 17:55:38 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-06-24 17:23:14 -0700
commit203063609b52f4125ee91c474cf5f58178572050 (patch)
treecf8560d8304a59b558efca9eb90649019b7dbba4 /include/ec_commands.h
parent3bc0223b48a73a9fcc70cdbec886f22dd6c35cd3 (diff)
downloadchrome-ec-203063609b52f4125ee91c474cf5f58178572050.tar.gz
usb_mux: Add support for host-controlled 'virtual' USB mux
For designs where the host SOC is responsible for setting the USB-C SS mux, the EC must track the desired mux state and inform the host when the desired state changes. Then, the host must ask the EC for the new desired state and set the mux accordingly. BUG=chrome-os-partner:52639 BRANCH=None TEST=Manual on gru with subsequent commit. Attach USB dongle in port 1 and DP dongle in port 0, then verify `ectool usbpdmuxinfo` output: Port 0: DP Port 1: USB Flip DP dongle and verify output changes: Port 0: DP INV Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I6a99ce93a76c3197f9195cfaa25c5217d09aeb75 Reviewed-on: https://chromium-review.googlesource.com/355281 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 226d3bf04f..18343ef104 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -440,6 +440,9 @@ enum host_event_code {
/* Emulate MKBP event */
EC_HOST_EVENT_MKBP = 27,
+ /* EC desires to change state of host-controlled USB mux */
+ EC_HOST_EVENT_USB_MUX = 28,
+
/*
* The high bit of the event mask is not used as a host event code. If
* it reads back as set, then the entire event mask should be
@@ -950,6 +953,8 @@ enum ec_feature_code {
EC_FEATURE_MOTION_SENSE_FIFO = 24,
/* Support temporary secure vstore */
EC_FEATURE_VSTORE = 25,
+ /* EC decides on USB-C SS mux state, muxes configured by host */
+ EC_FEATURE_USBC_SS_MUX_VIRTUAL = 26,
};
#define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32))
@@ -3665,6 +3670,22 @@ struct ec_params_pd_control {
uint8_t subcmd;
} __packed;
+/* Get info about USB-C SS muxes */
+#define EC_CMD_USB_PD_MUX_INFO 0x11a
+
+struct ec_params_usb_pd_mux_info {
+ uint8_t port; /* USB-C port number */
+} __packed;
+
+/* Flags representing mux state */
+#define USB_PD_MUX_USB_ENABLED (1 << 0)
+#define USB_PD_MUX_DP_ENABLED (1 << 1)
+#define USB_PD_MUX_POLARITY_INVERTED (1 << 2)
+
+struct ec_response_usb_pd_mux_info {
+ uint8_t flags; /* USB_PD_MUX_*-encoded USB mux state */
+} __packed;
+
#endif /* !__ACPI__ */
/*****************************************************************************/