summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTodd Broch <tbroch@chromium.org>2015-02-11 15:15:40 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-12 23:08:37 +0000
commit7c1f189edc3d3a937746ccae01012868398f70ef (patch)
tree409720e6270631aa4c00ec3e973f6e9eb623fe88 /common
parent80778ad0eb0f2a7a156f02b68eb7103687c245fb (diff)
downloadchrome-ec-7c1f189edc3d3a937746ccae01012868398f70ef.tar.gz
pd: DRP: VCONN should be off at start of pd task.
VCONN should be off at the start of pd task. This is handled initially by the defaults in gpio.inc. However in the case of a sysjump after a RW only firmware update the previous state would be preserved. This in turn would allow us to evaluate polarity incorrectly if an accessory was connected in the CC2 polarity and subsequently enable both VCONNs which would leave the port with both CCx lines at 3.3V. This change adds a new function, pd_config_init, which initializes VCONN(s) to off. Future CLs will evaluate other PD related GPIOs that may be left unitialized as a result of sysjump. Signed-off-by: Todd Broch <tbroch@chromium.org> BRANCH=samus BUG=chrome-os-partner:36481 TEST=manual, 1. Boot samus w/ samus_pd in RO 2. connect hoho | dingdong in CC2 polarity to type-C port 3. sysjump to RW 4. unplug / plug hoho | dingdongs No longer see both VCONNs enabled. Change-Id: Ia53c06ea8face4da6829f9667f4f44a9034183be Reviewed-on: https://chromium-review.googlesource.com/248831 Trybot-Ready: Todd Broch <tbroch@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usb_pd_protocol.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 18a217528b..40126aa8fe 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -1775,6 +1775,10 @@ void pd_task(void)
/* Initialize TX pins and put them in Hi-Z */
pd_tx_init();
+#if defined(CONFIG_USB_PD_DUAL_ROLE) && defined(CONFIG_USB_PD_ALT_MODE_DFP)
+ pd_config_init(port);
+#endif
+
/* Initialize PD protocol state variables for each port. */
pd[port].power_role = PD_ROLE_DEFAULT;
pd_set_data_role(port, PD_ROLE_DEFAULT);