summaryrefslogtreecommitdiff
path: root/driver/charger
diff options
context:
space:
mode:
authorMarco Chen <marcochen@chromium.org>2020-04-24 14:34:32 +0800
committerCommit Bot <commit-bot@chromium.org>2020-04-29 22:01:59 +0000
commitd1f0d51080ba59fcaf266381fcceb4f32315af05 (patch)
tree508f6224313e329e5280d3dd204375ec49727b1e /driver/charger
parentfe253207e94a3033c44d126ec5ab5208f24efe47 (diff)
downloadchrome-ec-d1f0d51080ba59fcaf266381fcceb4f32315af05.tar.gz
raa489000: Bit 7 of control3 is to enable autonomous charging
Comparing to ISL9238, where the bit 7 of control 3 is to DISABLE autonomous charging. But in RAA489000, the bit is to ENABLE actually. BUG=b:154879806 BRANCH=None TEST=flash image and verify that device reports bit 7 of control 3 is 0. Signed-off-by: Marco Chen <marcochen@chromium.org> Change-Id: I1bc9090c337d1a22fb5241b03a3345a39eb4931a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2162448 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'driver/charger')
-rw-r--r--driver/charger/isl923x.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c
index 1ef3cd0eda..e50060ec29 100644
--- a/driver/charger/isl923x.c
+++ b/driver/charger/isl923x.c
@@ -486,8 +486,13 @@ static void isl923x_init(int chgnum)
* loop issues with 2S batteries, and 2) it will automatically
* get disabled as soon as we manually set the current limit
* anyway.
+ *
+ * Note: This bit is inverted on the RAA489000.
*/
- reg |= ISL9238_C3_DISABLE_AUTO_CHARING;
+ if (IS_ENABLED(CONFIG_CHARGER_RAA489000))
+ reg &= ~ISL9238_C3_DISABLE_AUTO_CHARING;
+ else
+ reg |= ISL9238_C3_DISABLE_AUTO_CHARING;
if (raw_write16(chgnum, ISL9238_REG_CONTROL3, reg))
goto init_fail;