diff options
author | Philip Chen <philipchen@google.com> | 2018-02-28 16:59:27 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-03-02 15:47:00 -0800 |
commit | 69c18ad6a6a77ea1c82465e6420280c8cf55b12f (patch) | |
tree | ca4349df5ff484d5e61c88ef7261b56430c63803 /board/scarlet | |
parent | f6b72676a0e4794805b14ab3452db7c82b989518 (diff) | |
download | chrome-ec-69c18ad6a6a77ea1c82465e6420280c8cf55b12f.tar.gz |
scarlet: Enable 4A charging for Simplo battery
Simplo update battery spec again -
the maximal charging current can be 4A now.
BUG=b:70820167
BRANCH=scarlet
TEST=build scarlet
Change-Id: I52e295b83563240aed73944107b00649c9b422b1
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/942370
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-by: David Schneider <dnschneid@chromium.org>
Diffstat (limited to 'board/scarlet')
-rw-r--r-- | board/scarlet/battery.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/board/scarlet/battery.c b/board/scarlet/battery.c index 8b714ebec7..d84e8c1d6c 100644 --- a/board/scarlet/battery.c +++ b/board/scarlet/battery.c @@ -142,7 +142,7 @@ int charger_profile_override(struct charge_state_data *curr) TEMP_ZONE_COUNT } temp_zone; - static const struct { + static struct { int temp_min; /* 0.1 deg C */ int temp_max; /* 0.1 deg C */ int desired_current; /* mA */ @@ -150,8 +150,8 @@ int charger_profile_override(struct charge_state_data *curr) } temp_zones[BATTERY_COUNT][TEMP_ZONE_COUNT] = { [BATTERY_SIMPLO] = { {0, 150, 1772, 4400}, /* TEMP_ZONE_0 */ - {150, 450, 3000, 4400}, /* TEMP_ZONE_1 */ - {450, 600, 3000, 4100}, /* TEMP_ZONE_2 */ + {150, 450, 4000, 4400}, /* TEMP_ZONE_1 */ + {450, 600, 4000, 4100}, /* TEMP_ZONE_2 */ }, [BATTERY_AETECH] = { {0, 100, 900, 4200}, /* TEMP_ZONE_0 */ @@ -167,6 +167,17 @@ int charger_profile_override(struct charge_state_data *curr) BUILD_ASSERT(ARRAY_SIZE(temp_zones) == BATTERY_COUNT); static int charge_phase = 1; + static uint8_t quirk_batt_update; + + /* + * This is a quirk for old Simplo battery to clamp + * charging current to 3A. + */ + if ((board_get_version() <= 4) && !quirk_batt_update) { + temp_zones[BATTERY_SIMPLO][TEMP_ZONE_1].desired_current = 3000; + temp_zones[BATTERY_SIMPLO][TEMP_ZONE_2].desired_current = 3000; + quirk_batt_update = 1; + } if (batt_id >= BATTERY_COUNT) batt_id = gpio_get_level(GPIO_BATT_ID); |