summaryrefslogtreecommitdiff
path: root/board/reef/usb_pd_policy.c
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2016-10-26 13:58:25 +0200
committerchrome-bot <chrome-bot@chromium.org>2016-10-31 03:27:49 -0700
commitcf7ff32b92275f9d4cce4bc3bcaa7d8890b0cb2e (patch)
tree37b80e9f034a01ef8c2a38901500266273a9db92 /board/reef/usb_pd_policy.c
parent34066e92a92b6ff0f1b4b311b46d13b6a4ab45e3 (diff)
downloadchrome-ec-cf7ff32b92275f9d4cce4bc3bcaa7d8890b0cb2e.tar.gz
kevin: set accurate current limit on USB load switch
When sourcing current on the type-C port, set the OCP limit on the VBUS load switch according to current dynamic capability. (3.0A when only one port is a power source, 1.5A else) Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=gru BUG=chrome-os-partner:56110 TEST=manual: connect Caroline to Kevin with Twinkie in between, ask Caroline to sink current through the UI. without anything else connected on Kevin, see 3A flowing when measuring with Twinkie ('tw vbus'), plug a dangling C-to-A receptacle dongle on the other Kevin port and see 1.5A flowing through Twinkie. Force the input current limit on Caroline to 3.0A and see Kevin cutting VBUS. Change-Id: Ib879b1ed720b20aa702c5f3643948ba0575d1193 Reviewed-on: https://chromium-review.googlesource.com/403869 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'board/reef/usb_pd_policy.c')
-rw-r--r--board/reef/usb_pd_policy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/board/reef/usb_pd_policy.c b/board/reef/usb_pd_policy.c
index 6e515abf81..693bd6e2e4 100644
--- a/board/reef/usb_pd_policy.c
+++ b/board/reef/usb_pd_policy.c
@@ -51,6 +51,11 @@ void pd_transition_voltage(int idx)
/* No-operation: we are always 5V */
}
+int board_vbus_source_enabled(int port)
+{
+ return gpio_get_level(port ? GPIO_USB_C1_5V_EN : GPIO_USB_C0_5V_EN);
+}
+
int pd_set_power_supply_ready(int port)
{
/* Ensure we're not charging from this port */