summaryrefslogtreecommitdiff
path: root/board/dingdong
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-12-31 14:18:32 -0800
committerAlec Berg <alecaberg@chromium.org>2015-01-10 23:43:25 +0000
commitd83bd6b892e696c13f3584b5d3e1e0f51aafe710 (patch)
tree366798000953d830de5ed6c5902a8c76e570cdde /board/dingdong
parent193e23509f8b9df44852b4581c357f2d7caed0aa (diff)
downloadchrome-ec-d83bd6b892e696c13f3584b5d3e1e0f51aafe710.tar.gz
pd: implement new type-C connect state machine
Implement the new type-C connect state machine which removes lock and hold times and adds a debounce time to make sure CC lines settle before going into the attached state. This also adds detection of accessories, but doesn't do anything when an accessory is detected. BUG=chrome-os-partner:33680 BRANCH=samus TEST=test samus connected zinger and samus connected to samus. make sure that the connection is always formed. also tested with a third party with old state machine implementation and formed a connection every time. Change-Id: I91a7a6031bc35082cc19d7697142e4aa92ef46f2 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/238210 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/dingdong')
-rw-r--r--board/dingdong/usb_pd_config.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/board/dingdong/usb_pd_config.h b/board/dingdong/usb_pd_config.h
index ba6e545a3f..db46d83b73 100644
--- a/board/dingdong/usb_pd_config.h
+++ b/board/dingdong/usb_pd_config.h
@@ -120,7 +120,8 @@ static inline void pd_set_host_mode(int port, int enable) {}
static inline int pd_adc_read(int port, int cc)
{
- return adc_read_channel(ADC_CH_CC1_PD);
+ /* only one CC line, assume other one is always low */
+ return (cc == 0) ? adc_read_channel(ADC_CH_CC1_PD) : 0;
}
static inline int pd_snk_is_vbus_provided(int port)