diff options
author | Aseda Aboagye <aaboagye@google.com> | 2017-12-08 14:56:55 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-12-13 22:33:22 -0800 |
commit | 755517e2cfc213936107c60768455fd90748d75e (patch) | |
tree | da8241abbb58390eab4b25e78c364eff664bfcb0 /common/usbc_ppc.c | |
parent | e167d36b75ab13892abaf865860a6674a5a09b59 (diff) | |
download | chrome-ec-755517e2cfc213936107c60768455fd90748d75e.tar.gz |
ppc: Add API to set Vbus source ILIM.
The PPC needs to update its Vbus source current limits whenever our
policy changes on the PD ports. This commit simply adds and API to do
so.
BUG=None
BRANCH=None
TEST=With some extra code to enable 3A out, flash zoombini; Plug in a PD
device to a port, verify that it gets 5V @ 3A. Plug in a second device,
verify that we re-send new source caps of 5V @ 1.5A.
TEST=Repeat above for meowth.
Change-Id: Ifa4bc8b7df87f7730f2bcded842906d43171394b
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/818335
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common/usbc_ppc.c')
-rw-r--r-- | common/usbc_ppc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/usbc_ppc.c b/common/usbc_ppc.c index 081cef811f..9614660468 100644 --- a/common/usbc_ppc.c +++ b/common/usbc_ppc.c @@ -26,6 +26,14 @@ int ppc_is_sourcing_vbus(int port) return ppc_chips[port].drv->is_sourcing_vbus(port); } +int ppc_set_vbus_source_current_limit(int port, enum tcpc_rp_value rp) +{ + if ((port < 0) || (port >= ppc_cnt)) + return EC_ERROR_INVAL; + + return ppc_chips[port].drv->set_vbus_source_current_limit(port, rp); +} + int ppc_vbus_sink_enable(int port, int enable) { if ((port < 0) || (port >= ppc_cnt)) |