From 185455ac25228c8349fe4b3e22df791172a3e89a Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Mon, 12 Aug 2019 14:01:11 -0600 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1752705 --- driver/ppc/nx20p348x.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/driver/ppc/nx20p348x.c b/driver/ppc/nx20p348x.c index 35202c8fe8..4aa6700509 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; } -- cgit v1.2.1