summaryrefslogtreecommitdiff
path: root/board/plankton
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 /board/plankton
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 'board/plankton')
-rw-r--r--board/plankton/usb_pd_config.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/board/plankton/usb_pd_config.h b/board/plankton/usb_pd_config.h
index 6fd5b9c48a..c1fefbcf7e 100644
--- a/board/plankton/usb_pd_config.h
+++ b/board/plankton/usb_pd_config.h
@@ -129,6 +129,20 @@ static inline void pd_set_host_mode(int port, int enable)
board_pd_set_host_mode(enable);
}
+/**
+ * Initialize various GPIOs and interfaces to safe state at start of pd_task.
+ *
+ * These include:
+ * VCONNs disabled.
+ *
+ * @param port USB-C port number
+ */
+static inline void pd_config_init(int port)
+{
+ gpio_set_level(GPIO_USB_CC1_VCONN_EN_L, 1);
+ gpio_set_level(GPIO_USB_CC2_VCONN_EN_L, 1);
+}
+
static inline int pd_adc_read(int port, int cc)
{
if (board_pd_fake_disconnected())