From 8a909ba35dc9f7787d489ffa4c6567169f10fbb4 Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Mon, 23 Oct 2017 08:01:15 -0700 Subject: [PATCH] pd: Fix false USB-C DTS detection tcpm_get_cc() returns TYPEC_CC_VOLT_*, not TYPEC_CC_*. Check for RP rather than non-open to match USB-C spec (Table B-2 Rp/Rp Charging Current Values for a DTS Source). BUG=chromium:775542 BRANCH=servo TEST=Verify donette and guppy are not detected as DTS, verify suzy-qable is detected as DTS, on kevin DUT. Signed-off-by: Shawn Nematbakhsh Change-Id: I0ff5550e9171ff86b42b489525044bf63827240c Reviewed-on: https://chromium-review.googlesource.com/733220 Commit-Ready: Shawn N Tested-by: Shawn N Reviewed-by: Vincent Palatin --- common/usb_pd_protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 0c353604b2..61a329f3ed 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -1531,7 +1531,7 @@ static typec_current_t get_typec_current_limit(int polarity, int cc1, int cc2) else charge = 0; - if (cc_alt != TYPEC_CC_OPEN) + if (cc_is_rp(cc_alt)) charge |= TYPEC_CURRENT_DTS_MASK; return charge;