summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2017-10-06 09:19:12 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-06 13:47:20 -0700
commit4bd4161317ad1a3bad6b90541ddfbfdc48f6d31e (patch)
tree4c6688f8706a5564f1400a39917f58ba6053f5af
parent0dac0876e52321015600792a98b3f17033fb643f (diff)
downloadchrome-ec-4bd4161317ad1a3bad6b90541ddfbfdc48f6d31e.tar.gz
coral: Update Nasher SMP-SDI3.72 battery FET info
The Nasher simplo battery uses the Reneas fuel gauge. The table entry for this battery had TI fuel gauge assumption. This CL modifies the FET info to use register 0x43 and bits 1|0. In addition added console log entry for the FET register, mask, and expected value. In normal cases this log message will appear only once, but when recovering from battery cutoff, will have have one entry per call until the battery is no reporting as disconnected. BUG=b:64887361 BRANCH=None TEST=Using nasher proto system connected the SMP-SDI3.72 battery. Tested normal start up and after doing a battery cutoff. Normal caseL: [0.038624 found batt:SMP-SDI3.72} [0.046017 SW 0x01] [0.068892 hash start 0x00040000 0x00020d08] [0.075775 Battery FET: reg 0x001b mask 0x0003 disc 0x0000] After battery cutoff: [0.146889 Battery FET: reg 0x0008 mask 0x0003 disc 0x0000] [0.161523 Battery FET: reg 0x0008 mask 0x0003 disc 0x0000] . . [0.476275 Battery FET: reg 0x001b mask 0x0003 disc 0x0000] Change-Id: Ie378e9a795f543763a02c6c062235b265be0f71c Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/705260 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--board/coral/battery.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/board/coral/battery.c b/board/coral/battery.c
index 608590ebf7..ba4e75c0d5 100644
--- a/board/coral/battery.c
+++ b/board/coral/battery.c
@@ -387,9 +387,9 @@ static const struct board_batt_params info[] = {
.reg_data = { 0x10, 0x10 },
},
.fet = {
- .reg_addr = 0x0,
- .reg_mask = 0x6000,
- .disconnect_val = 0x6000,
+ .reg_addr = 0x43,
+ .reg_mask = 0x0003,
+ .disconnect_val = 0x0000,
}
},
.batt_info = {
@@ -605,6 +605,9 @@ static int battery_check_disconnect(void)
if (rv)
return BATTERY_DISCONNECT_ERROR;
+ CPRINTS("Battery FET: reg 0x%04x mask 0x%04x disc 0x%04x", reg,
+ info[board_battery_type].fuel_gauge.fet.reg_mask,
+ info[board_battery_type].fuel_gauge.fet.disconnect_val);
reg &= info[board_battery_type].fuel_gauge.fet.reg_mask;
if (reg == info[board_battery_type].fuel_gauge.fet.disconnect_val)
return BATTERY_DISCONNECTED;