summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwen zhang <zhangwen6@huaqin.corp-partner.google.com>2023-04-26 11:28:05 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-11 19:38:12 +0000
commit5df400b0377c9e1b5bb6cfc53ba7dfedde91f944 (patch)
tree568d83029b76fd4cf56a0a20d22b43f7d38b3110
parent76d2b9b1e47ba721d83ada33f18a1aab28a80ea7 (diff)
downloadchrome-ec-5df400b0377c9e1b5bb6cfc53ba7dfedde91f944.tar.gz
chgstv2: Change battery near full depends on display SOC
The battery_near_full is used to set PWR_STATE_DISCHARGE_FULL and PWR_STATE_CHARGE_NEAR_FULL and these two states are used to set LED behaviors. We should change battery_near_full to depend on display SOC because LED bahaviors are already depends on display SOC. There is an exception, isl9241.c also checks charge_get_state() == PWR_STATE_CHARGE_NEAR_FULL in function isl9241_restart_charge_voltage_when_full. With this change, this feature will depend on the battery display SOC rather than RSOC. The display SOC is bigger than RSOC ~3% when the battery is BATTERY_LEVEL_NEAR_FULL(default 97%) so this feature may be 3% ahead of schedule. The 3% difference should have no harm for this feature. BUG=b:278512388 TEST=1.verify LED behavior on voltorb 2.no "E: Node with matching prop not found" on voltorb Change-Id: I87f555571e22cbcdd0e8e0a201f76e3de8204ebe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4478776 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com> Commit-Queue: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Tested-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com>
-rw-r--r--common/charge_state_v2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index 928c600c16..a603d4f108 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -1727,7 +1727,7 @@ bool charge_prevent_power_on(bool power_button_pressed)
static int battery_near_full(void)
{
- if (charge_get_percent() < CONFIG_BATT_HOST_FULL_FACTOR)
+ if (charge_get_display_charge() < 1000)
return 0;
if (IS_ENABLED(CONFIG_EC_EC_COMM_BATTERY_CLIENT) &&