summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-05-03 11:35:25 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-05 15:15:59 +0000
commit78c68ee1529fd13e0ea43f70cf097fad93aa0fa0 (patch)
treed6a36e480af95ad4ed3326398ce1264f06debd6a
parent0e98790ad5371770b5d87de3a9d6168397521616 (diff)
downloadchrome-ec-78c68ee1529fd13e0ea43f70cf097fad93aa0fa0.tar.gz
charger: Rename charge_allocate_input_current_limit()
Add a base_ prefix to this so that it is clear it relates to the base handling. Also drop the #ifdef by moving the function outside it. This makes no functional change. BUG=b:218332694 TEST=zmake build dev-posix Change-Id: I40ba3fec0141e3b382f9801fc26cfee5bff92cd6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4501290 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Tested-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
-rw-r--r--common/charge_state_v2.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index c70da4b326..dde612b81e 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -443,9 +443,12 @@ static int add_margin(int value, int m)
{
return value + m * value / 128;
}
+#endif /* CONFIG_EC_EC_COMM_BATTERY_CLIENT */
-static void charge_allocate_input_current_limit(void)
+/* allocate power between the base and the lid */
+static void base_charge_allocate_input_current_limit(void)
{
+#ifdef CONFIG_EC_EC_COMM_BATTERY_CLIENT
/*
* All the power numbers are in mW.
*
@@ -704,8 +707,8 @@ static void charge_allocate_input_current_limit(void)
if (debugging)
CPRINTF("====\n");
-}
#endif /* CONFIG_EC_EC_COMM_BATTERY_CLIENT */
+}
/* Update base battery information */
static void base_update_battery_info(void)
@@ -2026,11 +2029,11 @@ void charger_task(void *u)
#endif
}
-#ifdef CONFIG_EC_EC_COMM_BATTERY_CLIENT
- charge_allocate_input_current_limit();
-#else
- charge_request(curr.requested_voltage, curr.requested_current);
-#endif
+ if (IS_ENABLED(CONFIG_EC_EC_COMM_BATTERY_CLIENT))
+ base_charge_allocate_input_current_limit();
+ else
+ charge_request(curr.requested_voltage,
+ curr.requested_current);
/* How long to sleep? */
if (problems_exist)