From 2f4de76850dc6323febbbcf0b207a3fa2c8b211a Mon Sep 17 00:00:00 2001 From: Todd Broch Date: Wed, 27 Aug 2014 16:15:31 -0700 Subject: [PATCH] pd: Set pd mux to USB 3.0 (superspeed) initially. BRANCH=manual BUG=chrome-os-partner:28585 TEST=manual, Plug USB 3.0 capable device in both ports and both polarites on samus and see device enumerate as superspeed. For example, usb 2-3: new SuperSpeed USB device number 6 using xhci_hcd In order you must first connected device (hoho) prior to configuring mux via 'ectool --dev=1 --interface=lpc usbpd dp' Change-Id: Ia6b8a714ce9ae1539769399e51ff245d00202171 Signed-off-by: Todd Broch Reviewed-on: https://chromium-review.googlesource.com/214579 Reviewed-by: Alec Berg Reviewed-by: Vincent Palatin --- common/usb_pd_protocol.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index a8c22d9c69..3ab4719bb5 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -253,6 +253,12 @@ static inline void set_state(int port, enum pd_states next_state) set_state_timeout(port, 0, 0); pd[port].task_state = next_state; +#ifdef CONFIG_USBC_SS_MUX + if (next_state == PD_STATE_SRC_DISCONNECTED) + board_set_usb_mux(port, TYPEC_MUX_NONE, + pd[port].polarity); +#endif + /* Log state transition, except for toggling between sink and source */ if (last_state == next_state) return; @@ -1191,6 +1197,11 @@ void pd_task(void) (cc2_volt < PD_SRC_VNC)) { pd[port].polarity = !(cc1_volt < PD_SRC_VNC); pd_select_polarity(port, pd[port].polarity); + /* Set to USB SS initially */ +#ifdef CONFIG_USBC_SS_MUX + board_set_usb_mux(port, TYPEC_MUX_USB, + pd[port].polarity); +#endif /* Enable VBUS */ pd_set_power_supply_ready(port); set_state(port, PD_STATE_SRC_DISCOVERY);