summaryrefslogtreecommitdiff
path: root/board/banshee/charger.c
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2022-11-10 16:37:09 +1100
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-23 03:58:51 +0000
commitb75dc90677f29424e6f0d63f294dce4b39782135 (patch)
tree17002ffbd6b6f660b1a5a1a1e1911e741fa4ac73 /board/banshee/charger.c
parentf1b563c350acf6a1b687c682f07770aa8210dc01 (diff)
downloadchrome-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/banshee/charger.c')
-rw-r--r--board/banshee/charger.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/board/banshee/charger.c b/board/banshee/charger.c
index 88f5b85a41..8edcb00e31 100644
--- a/board/banshee/charger.c
+++ b/board/banshee/charger.c
@@ -83,6 +83,5 @@ int board_set_active_charge_port(int port)
__overridable void board_set_charge_limit(int port, int supplier, int charge_ma,
int max_ma, int charge_mv)
{
- charge_set_input_current_limit(
- MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT), charge_mv);
+ charge_set_input_current_limit(charge_ma, charge_mv);
}