From 04bbd289ec5f4c62e39784b848edfcb5f55ea3c0 Mon Sep 17 00:00:00 2001 From: "YongBeum.Ha" Date: Mon, 9 Dec 2019 10:37:08 +0900 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1957605 Reviewed-by: Scott Collyer Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2784641 Reviewed-by: Aseda Aboagye Tested-by: Patryk Duda Commit-Queue: Patryk Duda --- board/kohaku/battery.c | 31 +++++++++++++++++++++++++++++++ board/kohaku/board.h | 1 + 2 files changed, 32 insertions(+) (limited to 'board') 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 -- cgit v1.2.1