diff options
author | YongBeum.Ha <ybha@samsung.corp-partner.google.com> | 2019-12-09 10:37:08 +0900 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-06 17:39:39 +0000 |
commit | 04bbd289ec5f4c62e39784b848edfcb5f55ea3c0 (patch) | |
tree | 572260bb60c460cf08f4223a6d2e319169580ba5 | |
parent | 42375e9e891ca39ece1faebb6e700e04e981e37b (diff) | |
download | chrome-ec-04bbd289ec5f4c62e39784b848edfcb5f55ea3c0.tar.gz |
kohaku : limit charging current to 0.45C
Change charging current from 0.72C to 0.45C when system is in S0
BUG=b:144532818
BRANCH=firmware-hatch-12672.B
TEST=FW_NAME=kohaku emerge-kohaku chromeos-ec & check charging current
Change-Id: Iba1dd08465b2469a6456cc04ad72a39c7af8b8a4
Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1957605
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2784641
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Patryk Duda <pdk@semihalf.com>
Commit-Queue: Patryk Duda <pdk@semihalf.com>
-rw-r--r-- | board/kohaku/battery.c | 31 | ||||
-rw-r--r-- | board/kohaku/board.h | 1 |
2 files changed, 32 insertions, 0 deletions
diff --git a/board/kohaku/battery.c b/board/kohaku/battery.c index 1d311d69f1..8d35008f6e 100644 --- a/board/kohaku/battery.c +++ b/board/kohaku/battery.c @@ -6,6 +6,7 @@ */ #include "battery_fuel_gauge.h" +#include "charge_state.h" #include "common.h" #include "system.h" #include "util.h" @@ -32,6 +33,10 @@ * status can be read with a sb_read() command and therefore, only the register * address, mask, and disconnect value need to be provided. */ + +/* charging current is limited to 0.45C */ +#define CHARGING_CURRENT_45C 2804 + const struct board_batt_params board_battery_info[] = { /* Dyna Battery Information */ [BATTERY_DYNA] = { @@ -106,3 +111,29 @@ enum battery_present variant_battery_present(void) */ return BP_YES; } + +int charger_profile_override(struct charge_state_data *curr) +{ + if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) + return 0; + + if (curr->requested_current > CHARGING_CURRENT_45C) + curr->requested_current = CHARGING_CURRENT_45C; + + return 0; +} + +/* Customs options controllable by host command. */ +#define PARAM_FASTCHARGE (CS_PARAM_CUSTOM_PROFILE_MIN + 0) + +enum ec_status charger_profile_override_get_param(uint32_t param, + uint32_t *value) +{ + return EC_RES_INVALID_PARAM; +} + +enum ec_status charger_profile_override_set_param(uint32_t param, + uint32_t value) +{ + return EC_RES_INVALID_PARAM; +} diff --git a/board/kohaku/board.h b/board/kohaku/board.h index 196365b9da..2baa196b06 100644 --- a/board/kohaku/board.h +++ b/board/kohaku/board.h @@ -113,6 +113,7 @@ */ #define CONFIG_CHARGER_BQ25710_IDCHG_LIMIT_MA 6144 #define CONFIG_BATTERY_CHECK_CHARGE_TEMP_LIMITS +#define CONFIG_CHARGER_PROFILE_OVERRIDE /* Volume Button feature */ #define CONFIG_VOLUME_BUTTONS |