diff options
author | Peter Marheine <pmarheine@chromium.org> | 2022-11-10 16:37:09 +1100 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-11-23 03:58:51 +0000 |
commit | b75dc90677f29424e6f0d63f294dce4b39782135 (patch) | |
tree | 17002ffbd6b6f660b1a5a1a1e1911e741fa4ac73 /board/reef_it8320 | |
parent | f1b563c350acf6a1b687c682f07770aa8210dc01 (diff) | |
download | chrome-ec-b75dc90677f29424e6f0d63f294dce4b39782135.tar.gz |
Add CONFIG_CHARGER_MIN_INPUT_CURRENT_LIMIT
This splits the dual use of CONFIG_CHARGER_INPUT_CURRENT into two
different symbols, changing the uses of that which are used to set a
minimum current limit to be CONFIG_CHARGER_MAX_INPUT_CURRENT_LIMIT.
Most boards implement this in the same way within either the board or
baseboard, so handling of the new option is moved into
charge_set_input_current_limit (which is called by every user of the
option) and every board which repeated this pattern has the new symbol
set to the same value as the old one, with the duplicated code deleted.
One functional change to the charge manager is made: when charging
stops, the input current limit is set to the default value
(CONFIG_CHARGER_INPUT_CURRENT) rather than 0. This captures the intent
that the default current is appropriate at any time, which was previously
configured by individual boards' implementation of board_set_charge_limit()
while still allowing the limit to be set lower as needed.
To verify that all changes are appropriate, the following has been
manually checked:
* All boards with a change to a .c file also have a .h change
* All boards without a changed .h file have a changed baseboard.h
* For Zephyr projects, those with a changed .c file have config added
for the minimum limit and others (only corsola) are unchanged to
leave it off.
This is intended to verify that each board that duplicated the MAX()
logic has its configuration updated to use the shared copy, and that
boards with that code in the baseboard also update their configuration.
BUG=b:163093572
TEST=make buildall; zmake build -a
BRANCH=none
LOW_COVERAGE_REASON=added lines will soon be deleted
Change-Id: Ia460a16293c1fb82aac3784fd9be57ba0985f2fe
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4019703
Reviewed-by: Keith Short <keithshort@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Diffstat (limited to 'board/reef_it8320')
-rw-r--r-- | board/reef_it8320/board.c | 3 | ||||
-rw-r--r-- | board/reef_it8320/board.h | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/board/reef_it8320/board.c b/board/reef_it8320/board.c index 6196f1967a..54a0995e85 100644 --- a/board/reef_it8320/board.c +++ b/board/reef_it8320/board.c @@ -311,8 +311,7 @@ void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma, if (bd9995x_bc12_enable_charging(port, bc12_enable)) return; - charge_set_input_current_limit( - MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT), charge_mv); + charge_set_input_current_limit(charge_ma, charge_mv); } /** diff --git a/board/reef_it8320/board.h b/board/reef_it8320/board.h index fc1ca0079d..558b10152a 100644 --- a/board/reef_it8320/board.h +++ b/board/reef_it8320/board.h @@ -49,6 +49,7 @@ #define CONFIG_CHARGER_BD9995X_CHGEN #define CONFIG_CHARGER_DISCHARGE_ON_AC #define CONFIG_CHARGER_INPUT_CURRENT 512 +#define CONFIG_CHARGER_MIN_INPUT_CURRENT_LIMIT 512 #define CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCT 5 #define CONFIG_CHARGER_LIMIT_POWER_THRESH_BAT_PCT 1 #define CONFIG_CHARGER_LIMIT_POWER_THRESH_CHG_MW 18000 |