summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRuibin Chang <Ruibin.Chang@ite.com.tw>2019-04-26 14:18:07 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-05-07 17:22:36 -0700
commit1c228d234fc939692bd054cf09058d2b7073d2fe (patch)
treef1415e9be08b16d94921bad62ea5f30759038da0 /include
parent38b1b041dddde3893ffae5bfbbc4eb2903e306b1 (diff)
downloadchrome-ec-1c228d234fc939692bd054cf09058d2b7073d2fe.tar.gz
usb_pd_protocol.c: exiting from try.src to attach.src
The port shall transition to Attached.SRC when the SRC.Rd state is detected on exactly "one of the CC1 or CC2 pins" for at least tTryCCDebounce. See TypeC v1.4 spec 4.5.2.2.10.2 Exiting from Try.SRC State. BRANCH=None BUG=b:130615676 TEST=1.Ampton with apple type-c adapter 2.Ellisys USB-PD test Change-Id: I461c53e2b8d9189f290956964754ae5b1a11a950 Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1564499 Commit-Ready: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/usb_pd_tcpm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h
index 1bfae8b540..c256a8961f 100644
--- a/include/usb_pd_tcpm.h
+++ b/include/usb_pd_tcpm.h
@@ -105,6 +105,14 @@ static inline int cc_is_at_least_one_rd(int cc1, int cc2)
return cc1 == TYPEC_CC_VOLT_RD || cc2 == TYPEC_CC_VOLT_RD;
}
+/**
+ * Returns true if the port partner is presenting Rd on only one CC line.
+ */
+static inline int cc_is_only_one_rd(int cc1, int cc2)
+{
+ return cc_is_at_least_one_rd(cc1, cc2) && cc1 != cc2;
+}
+
struct tcpm_drv {
/**
* Initialize TCPM driver and wait for TCPC readiness.