diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2015-05-28 08:47:18 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-05-28 19:08:23 +0000 |
commit | 3d69e505fc5f61045c0db1c0334f1425458d9029 (patch) | |
tree | bc11d88ec5a822f649273cf9cb9e71a04bc73fa2 | |
parent | 38c5ed205314691e1bf09b34324d1c25fbe44e55 (diff) | |
download | chrome-ec-3d69e505fc5f61045c0db1c0334f1425458d9029.tar.gz |
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 <vpalatin@chromium.org>
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 <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | common/usb_pd_protocol.c | 4 |
1 files 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; |