summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2019-08-06 17:59:15 -0700
committerCommit Bot <commit-bot@chromium.org>2020-07-17 04:22:18 +0000
commitefbe472ecb909934a8dc3bad551545de29d66329 (patch)
tree5306c8c8638fcbf0353ce079653e7e427ab1702a
parentc7a98a9f82fc32012c9ca23cc1bda2dc9a82fedf (diff)
downloadchrome-ec-efbe472ecb909934a8dc3bad551545de29d66329.tar.gz
usb_mux: Send DP safe mode info to virtual MUX
Before entering into alternate mode, state of the USB-C MUX needs to be in safe mode so that the USB-C pins cab be re-purposed without getting damaged or do not damage their Port Partner. Hence, sending the DP safe mode info to virtual MUX from EC. BUG=b:139140865 BRANCH=firmware-atlas-11827.B TEST=With other PD Policies patches, flash atlas and run faft_ec&pd Change-Id: I3715b5118112b7744407ac5e652f63f6d7cd0a1b Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1745540 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2296082 Tested-by: Dawid Niedźwiecki <dn@semihalf.com> Commit-Queue: Dossym Nurmukhanov <dossym@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
-rw-r--r--driver/usb_mux_virtual.c3
-rw-r--r--include/ec_commands.h1
-rw-r--r--include/usb_mux.h2
3 files changed, 5 insertions, 1 deletions
diff --git a/driver/usb_mux_virtual.c b/driver/usb_mux_virtual.c
index b82cdf307a..55007cef70 100644
--- a/driver/usb_mux_virtual.c
+++ b/driver/usb_mux_virtual.c
@@ -18,7 +18,8 @@
*/
#define USB_PD_MUX_HPD_STATE (USB_PD_MUX_HPD_LVL | USB_PD_MUX_HPD_IRQ)
#define USB_PD_MUX_USB_DP_STATE (USB_PD_MUX_USB_ENABLED | \
- USB_PD_MUX_DP_ENABLED | USB_PD_MUX_POLARITY_INVERTED)
+ USB_PD_MUX_DP_ENABLED | USB_PD_MUX_POLARITY_INVERTED | \
+ USB_PD_MUX_SAFE_MODE)
static mux_state_t virtual_mux_state[CONFIG_USB_PD_PORT_COUNT];
diff --git a/include/ec_commands.h b/include/ec_commands.h
index bc5cc09d31..12eb453ccb 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -5008,6 +5008,7 @@ struct ec_params_usb_pd_mux_info {
#define USB_PD_MUX_POLARITY_INVERTED (1 << 2) /* CC line Polarity inverted */
#define USB_PD_MUX_HPD_IRQ (1 << 3) /* HPD IRQ is asserted */
#define USB_PD_MUX_HPD_LVL (1 << 4) /* HPD level is asserted */
+#define USB_PD_MUX_SAFE_MODE (1 << 5) /* DP is in safe mode */
struct ec_response_usb_pd_mux_info {
uint8_t flags; /* USB_PD_MUX_*-encoded USB mux state */
diff --git a/include/usb_mux.h b/include/usb_mux.h
index e483954733..c38dc8a376 100644
--- a/include/usb_mux.h
+++ b/include/usb_mux.h
@@ -34,6 +34,7 @@ typedef uint8_t mux_state_t;
#define MUX_USB_ENABLED USB_PD_MUX_USB_ENABLED
#define MUX_DP_ENABLED USB_PD_MUX_DP_ENABLED
#define MUX_POLARITY_INVERTED USB_PD_MUX_POLARITY_INVERTED
+#define MUX_SAFE_MODE USB_PD_MUX_SAFE_MODE
/* Mux modes, decoded to attributes */
enum typec_mux {
@@ -42,6 +43,7 @@ enum typec_mux {
TYPEC_MUX_DP = MUX_DP_ENABLED, /* DP only */
TYPEC_MUX_DOCK = MUX_USB_ENABLED | /* Both USB and DP */
MUX_DP_ENABLED,
+ TYPEC_MUX_SAFE = MUX_SAFE_MODE, /* Safe mode */
};
/* Mux driver function pointers */