summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2022-04-26 13:40:45 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-02 23:44:32 +0000
commitd7304cb1d8be377f70523d40790d8699d8b8f42f (patch)
treedac798db4f02bcf188e7924fdc55398e050ecc66
parent96c7cd536662dea8ec2dd3509357c56c3174bfd7 (diff)
downloadchrome-ec-d7304cb1d8be377f70523d40790d8699d8b8f42f.tar.gz
ISL923x: Disable input regulation in driver init
Disable input regulation until other tasks such as USB-C, charger_manager, etc. have had time to gather information about the state of the connected charger. BUG=b:224616537 BRANCH=none TEST=make -j runtests Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ibc03ddaeb3eb699115b535947c4a917b0255ddb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3609108 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--driver/charger/isl923x.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c
index 011a83de27..5911e3276c 100644
--- a/driver/charger/isl923x.c
+++ b/driver/charger/isl923x.c
@@ -633,6 +633,14 @@ static void isl923x_init(int chgnum)
ISL923X_C2_ADAPTER_DEBOUNCE_150))
goto init_fail;
+ /*
+ * Disable input regulation until other tasks such as USB-C,
+ * charger_manager, etc. have had time to gather information
+ * about the state of the connected charger
+ */
+ if (isl923x_set_hw_ramp(chgnum, 0))
+ goto init_fail;
+
if (IS_ENABLED(CONFIG_CHARGE_RAMP_HW)) {
if (IS_ENABLED(CONFIG_CHARGER_ISL9237)) {
if (raw_read16(chgnum, ISL923X_REG_CONTROL0, &reg))
@@ -666,10 +674,6 @@ static void isl923x_init(int chgnum)
if (raw_write16(chgnum, ISL9238_REG_INPUT_VOLTAGE, reg))
goto init_fail;
}
- } else {
- /* Disable voltage regulation loop to disable charge ramp */
- if (isl923x_set_hw_ramp(chgnum, 0))
- goto init_fail;
}
if (IS_ENABLED(CONFIG_CHARGER_ISL9238C)) {