summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-06-15 15:38:10 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-06-16 04:25:58 +0000
commit1a78faf24707a790351cfa02a589af67373d3586 (patch)
tree9f5ef6da8aec0c056ab2b17e27ff87dfba6ee8c4
parentb46faa6af781a4b71a2f1f77d9daebc24a3e27f3 (diff)
downloadchrome-ec-1a78faf24707a790351cfa02a589af67373d3586.tar.gz
tcpc: initialize CC termination based on default PD role
Initialize CC termination variable based on the default PD role. BUG=chrome-os-partner:40920 BRANCH=none TEST=load on glados. test by rebooting PD from PD console with nothing plugged into the type-C ports. Without this change, the EC gets stuck in SNK_DISCONNECTED_DEBOUNCE, because the PD defaults to using the wrong termination and so the PD thinks the CC ADC readings represent Ra. At this point you have to reboot EC to get back to normal functionality. With this change, rebooting PD does not wedge the PD protocol state machine. Change-Id: I4eb6d881d8fc995be4d6a99ffa69e484141343f2 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/277666 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/usb_pd_tcpc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/usb_pd_tcpc.c b/common/usb_pd_tcpc.c
index 09eeddae25..0a5d60d95c 100644
--- a/common/usb_pd_tcpc.c
+++ b/common/usb_pd_tcpc.c
@@ -703,6 +703,8 @@ void tcpc_init(int port)
{
/* Initialize physical layer */
pd_hw_init(port, PD_ROLE_DEFAULT);
+ pd[port].cc_pull = PD_ROLE_DEFAULT == PD_ROLE_SOURCE ? TYPEC_CC_RP :
+ TYPEC_CC_RD;
/* make sure PD monitoring is disabled initially */
pd[port].rx_enabled = 0;