From 3d69e505fc5f61045c0db1c0334f1425458d9029 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Thu, 28 May 2015 08:47:18 -0700 Subject: pd: fix type-C current limit detection There was a small typo in get_typec_current_limit() since the introduction of the new TCPCI constants, we need to find the current limit by using the voltage values measured on the sink side. Signed-off-by: Vincent Palatin BRANCH=none BUG=chrome-os-partner:40719 TEST=Connect Donette to Ryu and see the current limit set to 3.0A using the "charger" command. Change-Id: Icb4a5ea4997265dc1edeeb4d3cc69e416b864707 Reviewed-on: https://chromium-review.googlesource.com/273679 Reviewed-by: Alec Berg Commit-Queue: Vincent Palatin Trybot-Ready: Vincent Palatin Tested-by: Vincent Palatin --- common/usb_pd_protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 470287c65d..05df773f74 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -1235,9 +1235,9 @@ static inline int get_typec_current_limit(int cc) int charge; /* Detect type C charger current limit based upon vbus voltage. */ - if (cc == TYPEC_CC_VOLT_SRC_3_0) + if (cc == TYPEC_CC_VOLT_SNK_3_0) charge = 3000; - else if (cc == TYPEC_CC_VOLT_SRC_1_5) + else if (cc == TYPEC_CC_VOLT_SNK_1_5) charge = 1500; else charge = 0; -- cgit v1.2.1