summaryrefslogtreecommitdiff
path: root/board/ryu/usb_pd_config.h
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-10-10 08:45:07 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-15 00:09:32 +0000
commit8b0fe914079793de4aa9dfa49ca83619b80e81b8 (patch)
tree0afc613a8911bf46d7f45c0fb5cd9f2e03b9e6a3 /board/ryu/usb_pd_config.h
parentc222d7b700efa20cbe7bcf4d86e9f5a6e32e8550 (diff)
downloadchrome-ec-8b0fe914079793de4aa9dfa49ca83619b80e81b8.tar.gz
pd: samus: ryu: add back in Vconn support correctly
Add support for enabling Vconn on Raiden ports by defining CONFIG_USBC_VCONN. This is enabled by default for ryu, samus, and fruitpie. BUG=chrome-os-partner:30445 BRANCH=samus TEST=Load onto samus. Make sure we can still charge from zinger. Plug in type-A to type-C adapter with pulldown and see that samus becomes power source. Do a gpioget and verify that only one VCONN GPIO is enabled (low), and the VCONN that is enabled is opposite of the polarity queried by pd 1 state. Try both ports, both polarities and make sure the correct VCONN gpio is enabled. Change-Id: Icea4c18b9c813cf7e8e21fd4f455bbd5fb4dbc91 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/222850 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/ryu/usb_pd_config.h')
-rw-r--r--board/ryu/usb_pd_config.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/board/ryu/usb_pd_config.h b/board/ryu/usb_pd_config.h
index cc1aa40f3c..3d7506d882 100644
--- a/board/ryu/usb_pd_config.h
+++ b/board/ryu/usb_pd_config.h
@@ -147,6 +147,13 @@ static inline int pd_adc_read(int port, int cc)
return adc_read_channel(ADC_CC2_PD);
}
+static inline void pd_set_vconn(int port, int polarity, int enable)
+{
+ /* Set VCONN on the opposite CC line from the polarity */
+ gpio_set_level(polarity ? GPIO_USBC_VCONN1_EN_L :
+ GPIO_USBC_VCONN2_EN_L, !enable);
+}
+
static inline int pd_snk_is_vbus_provided(int port)
{
return gpio_get_level(GPIO_CHGR_ACOK);