summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
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.