mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-17 18:41:22 +00:00
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>
This commit is contained in:
committed by
chrome-bot
parent
013494ad18
commit
23947f1d3b
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user