diff options
author | Jett Rink <jettrink@chromium.org> | 2019-08-12 14:01:11 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-13 23:11:50 +0000 |
commit | 61e32dd29e17e719fa76ded0cc5c659a4a182611 (patch) | |
tree | 40d90ac1ccabcdf894b4ae7c8b0c989cd89f1c8f /driver | |
parent | 15abbd295bc127b6b2ad3cf2e1a2a65901a9dcc1 (diff) | |
download | chrome-ec-61e32dd29e17e719fa76ded0cc5c659a4a182611.tar.gz |
ppc: initialize vbus current limit on init
The nx20p348 should also set the initial current limit during its
initialization.
BRANCH=octopus
BUG=b:139110010,b:139201733
TEST=with CL stack, phaser limits both ports to 1.5A
Change-Id: I876b32434bd37bf410d546a3d27f0f7ba949d3ea
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1749945
Commit-Queue: Edward Hill <ecgh@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/ppc/nx20p348x.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/driver/ppc/nx20p348x.c b/driver/ppc/nx20p348x.c index e47f8e9a8a..8de5b5d620 100644 --- a/driver/ppc/nx20p348x.c +++ b/driver/ppc/nx20p348x.c @@ -220,6 +220,7 @@ static int nx20p348x_init(int port) int mask; int mode; int rv; + enum tcpc_rp_value initial_current_limit; /* Mask interrupts for interrupt 2 register */ mask = ~NX20P348X_INT2_EN_ERR; @@ -276,6 +277,14 @@ static int nx20p348x_init(int port) */ nx20p348x_set_ovp_limit(port); + /* Set the Vbus current limit after dead battery mode exit */ +#ifdef CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT + initial_current_limit = CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT; +#else + initial_current_limit = TYPEC_RP_1A5; +#endif + nx20p348x_set_vbus_source_current_limit(port, initial_current_limit); + return EC_SUCCESS; } |