summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-05-17 14:11:54 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-18 14:33:19 -0700
commit23947f1d3b79479efa11c7caffaa35cd4f314926 (patch)
treec85f613f5ae891e71a34788f1302477e68c035a6 /baseboard
parent013494ad1830ce00070e0fbd32c2ea635afdc1bb (diff)
downloadchrome-ec-23947f1d3b79479efa11c7caffaa35cd4f314926.tar.gz
octopus: Display battery FET console message only when disconnected
With CONFIG_BATTERY_REVIVE_DISCONNECT once the battery FULL flag gets set, charge_state_v2 will call battery_get_disconnect_state. That function had console print that's only meaningful when the battery is actually disconnected. To avoid flooding the EC console log under this expected condition, this CL moves the console log so that it only happens when the battery is present, but disconnected. BRANCH=none BUG=b:79133101 TEST=Verfied that with full battery the console log message is no longer showing. Also verifed that can recover from battery cutoff condition. Change-Id: Id2e161cbd52c0ef07f28b94608f9615071327c97 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1064975 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/octopus/battery.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/baseboard/octopus/battery.c b/baseboard/octopus/battery.c
index 5de22c6509..0f76f5d9cd 100644
--- a/baseboard/octopus/battery.c
+++ b/baseboard/octopus/battery.c
@@ -205,12 +205,14 @@ enum battery_disconnect_state battery_get_disconnect_state(void)
if (rv)
return BATTERY_DISCONNECT_ERROR;
- CPRINTS("Battery FET: reg 0x%04x mask 0x%04x disc 0x%04x", reg,
- board_battery_info[type].fuel_gauge.fet.reg_mask,
- board_battery_info[type].fuel_gauge.fet.disconnect_val);
- reg &= board_battery_info[type].fuel_gauge.fet.reg_mask;
- if (reg == board_battery_info[type].fuel_gauge.fet.disconnect_val)
+ if ((reg & board_battery_info[type].fuel_gauge.fet.reg_mask) ==
+ board_battery_info[type].fuel_gauge.fet.disconnect_val) {
+ CPRINTS("Batt disconnected: reg 0x%04x mask 0x%04x disc 0x%04x",
+ reg,
+ board_battery_info[type].fuel_gauge.fet.reg_mask,
+ board_battery_info[type].fuel_gauge.fet.disconnect_val);
return BATTERY_DISCONNECTED;
+ }
return BATTERY_NOT_DISCONNECTED;
}