summaryrefslogtreecommitdiff
path: root/driver/charger/isl923x.c
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2018-01-31 18:34:29 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-02-01 02:41:55 -0800
commit61b602d2928fdf1d5a786f07714bc1d2087c54af (patch)
tree45393b5f40efef5fbf478da94b58ce62541837fe /driver/charger/isl923x.c
parentd138e4dc636f0a58fa2a90ed63b0a996f96e7a82 (diff)
downloadchrome-ec-61b602d2928fdf1d5a786f07714bc1d2087c54af.tar.gz
isl923x: Don't initialize ICL on sysjump.
The ISL923x init function would initialize the charger's input current to the board's defined default. For some boards like meowth and zoombini, the default input current was set quite low, 128mA. When sysjumping, all HOOK_INITs are called again and therefore the input current limit would be reset even thought it would have been set correctly prior to jumping. Setting the current limit so low, without a battery, would cause a power failure and the PMIC would drop its power OK signal and go into emergency shutdown. This commit simply adds a check to whether the EC jumped to this image. If it has, the charger input current limit is left unchanged. It will be updated to the correct value by charge manager later on after determine the attached charge supplier. BUG=b:72129338 BRANCH=None TEST=Flash meowth; Boot to S0 without a battery; Verify that PMIC_DPWROK remains high. TEST=Repeat above test for zoombini. Change-Id: I7e5bbbbf3ec604c876cc4fa0163f8bb7feff4cc9 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/896960 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Caveh Jalali <caveh@google.com>
Diffstat (limited to 'driver/charger/isl923x.c')
-rw-r--r--driver/charger/isl923x.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c
index 5f6312c7c7..b4fdb04ec5 100644
--- a/driver/charger/isl923x.c
+++ b/driver/charger/isl923x.c
@@ -14,6 +14,7 @@
#include "hooks.h"
#include "i2c.h"
#include "isl923x.h"
+#include "system.h"
#include "task.h"
#include "timer.h"
#include "util.h"
@@ -366,6 +367,13 @@ static void isl923x_init(void)
goto init_fail;
/*
+ * No need to proceed with the rest of init if we sysjump'd to this
+ * image as the input current limit has already been set.
+ */
+ if (system_jumped_to_this_image())
+ return;
+
+ /*
* Initialize the input current limit to the board's default.
*/
if (charger_set_input_current(CONFIG_CHARGER_INPUT_CURRENT))