usb-pd: Apply Vconn before Vbus as per USB TypeC spec (v 1.3)

According to table 4-25 in USB TypeC spec version 1.3, Vconn should be
sourced before Vbus or within 2ms. On Grunt I am see tVconnON around 2.3
ms, which is out of spec. We can simply source Vconn first to comply with
spec.

BRANCH=none
BUG=b:72811851
TEST=Grunt's tVonnOn is now <2ms

Change-Id: I52ca6a52bf576487061b2c33f348edf58eb06ca0
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/911928
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Jett Rink
2018-02-09 08:59:13 -07:00
committed by chrome-bot
parent 5d793e44c4
commit 242cd4e3ad

View File

@@ -2353,26 +2353,35 @@ void pd_task(void *u)
pd[port].flags |=
PD_FLAGS_TS_DTS_PARTNER;
#ifdef CONFIG_USBC_VCONN
/*
* Start sourcing Vconn before Vbus to ensure
* we are within USB Type-C Spec 1.3 tVconnON
*/
set_vconn(port, 1);
pd[port].flags |= PD_FLAGS_VCONN_ON;
#endif
#ifndef CONFIG_USBC_BACKWARDS_COMPATIBLE_DFP
/* Enable VBUS */
if (pd_set_power_supply_ready(port)) {
#ifdef CONFIG_USBC_VCONN
/* Stop sourcing Vconn if Vbus failed */
set_vconn(port, 0);
pd[port].flags &= ~PD_FLAGS_VCONN_ON;
#endif /* CONFIG_USBC_VCONN */
#ifdef CONFIG_USBC_SS_MUX
usb_mux_set(port, TYPEC_MUX_NONE,
USB_SWITCH_DISCONNECT,
pd[port].polarity);
#endif
#endif /* CONFIG_USBC_SS_MUX */
break;
}
#endif
#endif /* CONFIG_USBC_BACKWARDS_COMPATIBLE_DFP */
/* If PD comm is enabled, enable TCPC RX */
if (pd_comm_is_enabled(port))
tcpm_set_rx_enable(port, 1);
#ifdef CONFIG_USBC_VCONN
set_vconn(port, 1);
pd[port].flags |= PD_FLAGS_VCONN_ON;
#endif
pd[port].flags |= PD_FLAGS_CHECK_PR_ROLE |
PD_FLAGS_CHECK_DR_ROLE;
hard_reset_count = 0;