diff options
author | Aseda Aboagye <aaboagye@google.com> | 2020-11-20 16:59:27 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-23 18:32:17 +0000 |
commit | 5421f90715c09ef638ce3d9b0661d51e8108017f (patch) | |
tree | 8ebec51663051341a8b9246060a622e39596b809 /driver | |
parent | 813eb1f4b13150bee964614a57e1e099aba0c83d (diff) | |
download | chrome-ec-5421f90715c09ef638ce3d9b0661d51e8108017f.tar.gz |
raa489000: Adjust charger IC settings for ripple
This commit updates some of the charger IC settings to help reduce the
current ripple. These settings including enable hysteresis for
DCM/CCM as well as reducing the switching frequency to 600KHz.
BUG=b:163056834
BRANCH=dedede
TEST=Build and flash waddledoo, verify that input current ripple is
reduced.
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: I8c19ed040b92cf833d132ad247e761849985a919
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552860
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/charger/isl923x.c | 22 | ||||
-rw-r--r-- | driver/charger/isl923x.h | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c index 454aef494c..ac11893e20 100644 --- a/driver/charger/isl923x.c +++ b/driver/charger/isl923x.c @@ -484,6 +484,28 @@ static void isl923x_init(int chgnum) RAA489000_C4_PSYS_RSNS_RATIO_1_TO_1)) goto init_fail; } + + /* + * Enable hysteresis for CCM/DCM boundary to help with ripple. + */ + if (raw_read16(chgnum, ISL9238_REG_CONTROL3, ®)) + goto init_fail; + + if (raw_write16(chgnum, ISL9238_REG_CONTROL3, + reg | + RAA489000_C3_DCM_CCM_HYSTERESIS_ENABLE)) + goto init_fail; + + /* Set switching frequency to 600KHz to help with ripple. */ + if (raw_read16(chgnum, ISL923X_REG_CONTROL1, ®)) + goto init_fail; + + reg &= ~ISL923X_C1_SWITCH_FREQ_MASK; + + if (raw_write16(chgnum, ISL923X_REG_CONTROL1, + reg | + ISL9237_C1_SWITCH_FREQ_599K)) + goto init_fail; } if (IS_ENABLED(CONFIG_TRICKLE_CHARGING)) diff --git a/driver/charger/isl923x.h b/driver/charger/isl923x.h index 9b38b623e9..8194cdfb7d 100644 --- a/driver/charger/isl923x.h +++ b/driver/charger/isl923x.h @@ -247,6 +247,9 @@ /* Control3: Enables or disables Battery Ship mode */ #define ISL9238_C3_BGATE_OFF BIT(10) +/* Control3: Enable or disable DCM/CCM Hysteresis */ +#define RAA489000_C3_DCM_CCM_HYSTERESIS_ENABLE BIT(10) + /* Control3: Don't reload ACLIM on ACIN. */ #define ISL9238_C3_NO_RELOAD_ACLIM_ON_ACIN BIT(14) |