diff options
author | Peter Marheine <pmarheine@chromium.org> | 2022-11-14 13:13:50 +1100 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-11-29 01:05:08 +0000 |
commit | 57b32569630025bea009a13fc46d1354debe3fdc (patch) | |
tree | 8ceba06e674bbbcd60575e392b109d122e379c68 /common | |
parent | 1497d466220fc32f5d857883c4902a43c394059c (diff) | |
download | chrome-ec-57b32569630025bea009a13fc46d1354debe3fdc.tar.gz |
Rename CONFIG_CHARGER_INPUT_CURRENT to _CHARGER_DEFAULT_CURRENT_LIMIT
"Default input current" is not a very clear name, so rename this option to
better express its use as a default value that is set in the charger.
This is made possible by splitting other uses into
CHARGER_MIN_INPUT_CURRENT_LIMIT, making the only use for
CHARGER_INPUT_CURRENT be as a default.
BUG=b:163093572
TEST=make buildall; zmake build -a
BRANCH=none
LOW_COVERAGE_REASON=isl9241 and sm5803 currently lack emulators
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Change-Id: Ia9c1df9061825b15477466e85343afeb2a371288
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4025404
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/charge_manager.c | 4 | ||||
-rw-r--r-- | common/charge_state_v2.c | 4 | ||||
-rw-r--r-- | common/ec_ec_comm_server.c | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/common/charge_manager.c b/common/charge_manager.c index 683daaccf6..703b8933db 100644 --- a/common/charge_manager.c +++ b/common/charge_manager.c @@ -835,8 +835,8 @@ static void charge_manager_refresh(void) override_port = OVERRIDE_OFF; if (new_supplier == CHARGE_SUPPLIER_NONE) { -#ifdef CONFIG_CHARGER_INPUT_CURRENT - new_charge_current = CONFIG_CHARGER_INPUT_CURRENT; +#ifdef CONFIG_CHARGER_DEFAULT_CURRENT_LIMIT + new_charge_current = CONFIG_CHARGER_DEFAULT_CURRENT_LIMIT; #else new_charge_current = 0; #endif diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 1e1353a639..05c06cd77e 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -1507,9 +1507,9 @@ static int get_desired_input_current(enum battery_present batt_present, int ilim = charge_manager_get_charger_current(); return ilim == CHARGE_CURRENT_UNINITIALIZED ? CHARGE_CURRENT_UNINITIALIZED : - MAX(CONFIG_CHARGER_INPUT_CURRENT, ilim); + MAX(CONFIG_CHARGER_DEFAULT_CURRENT_LIMIT, ilim); #else - return CONFIG_CHARGER_INPUT_CURRENT; + return CONFIG_CHARGER_DEFAULT_CURRENT_LIMIT; #endif } else { #ifdef CONFIG_USB_POWER_DELIVERY diff --git a/common/ec_ec_comm_server.c b/common/ec_ec_comm_server.c index 6f37004513..976c3d6996 100644 --- a/common/ec_ec_comm_server.c +++ b/common/ec_ec_comm_server.c @@ -169,8 +169,9 @@ handle_cmd_charger_control(const struct ec_params_charger_control *params, goto out; } - /* Reset input current to minimum. */ - charge_set_input_current_limit(CONFIG_CHARGER_INPUT_CURRENT, 0); + /* Reset input current to default. */ + charge_set_input_current_limit( + CONFIG_CHARGER_DEFAULT_CURRENT_LIMIT, 0); /* Setup and enable "OTG". */ charge_set_output_current_limit(CHARGER_SOLO, -params->max_current, |