diff options
author | Jon Murphy <jpmurphy@google.com> | 2022-04-21 15:01:54 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-02 18:56:04 +0000 |
commit | 970772dbef059fcf42b4aabcde1ddd44f5f82c7e (patch) | |
tree | 2b2e75f31172ff08577e3db8cbc38f9ebf8a013d | |
parent | 9c8b7749e968f8762a50a17cb17adad935e8e038 (diff) | |
download | chrome-ec-970772dbef059fcf42b4aabcde1ddd44f5f82c7e.tar.gz |
nipperkin: Set DC prochot current thresh at init
Nipperkin devices are spiking current frequently exceeding the 4 A
threshold for over current prochot assertion on the ISL. Testing
shows that setting the current threshold limit to ~6 A will minimize
the impact to the user. Care should be taken not to exceed this value
on Nipperkin devices as the battery will cutoff if sustained current is
>= 6A for a duration of 10 mS. Keeping the current threshold below 6A
gives the device a chance to assert prochot and avoid a DC cutoff.
BUG=b:216489130
TEST=Boot, verify that the ISL dc prochot threshold register is set to
5.888 A
BRANCH=guybrush
Signed-off-by: Jon Murphy <jpmurphy@google.com>
Change-Id: I7ed388ab535dad228c40fbe5bcb108679d985418
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3600625
Reviewed-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-by: Rob Barnes <robbarnes@google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r-- | board/nipperkin/board.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/board/nipperkin/board.c b/board/nipperkin/board.c index 46e7749eab..432eb06e79 100644 --- a/board/nipperkin/board.c +++ b/board/nipperkin/board.c @@ -14,6 +14,7 @@ #include "chipset.h" #include "common.h" #include "cros_board_info.h" +#include "driver/charger/isl9241.h" #include "driver/retimer/pi3hdx1204.h" #include "driver/retimer/ps8811.h" #include "driver/retimer/ps8818.h" @@ -532,3 +533,14 @@ void board_set_current_limit(void) } DECLARE_HOOK(HOOK_BATTERY_SOC_CHANGE, board_set_current_limit, HOOK_PRIO_INIT_EXTPOWER); + +/* Set the DCPROCHOT base on battery over discharging current 5.888A */ +static void set_dc_prochot(void) +{ + /* + * Only bits 13:8 are usable for this register, any other bits will be + * truncated. Valid values are 256 mA to 16128 mA at 256 mA intervals. + */ + isl9241_set_dc_prochot(CHARGER_SOLO, 5888); +} +DECLARE_HOOK(HOOK_INIT, set_dc_prochot, HOOK_PRIO_DEFAULT); |