summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2019-11-08 14:38:28 -0800
committerCommit Bot <commit-bot@chromium.org>2019-11-11 21:10:12 +0000
commit138d51f1b93cb44eb93b0ea20cd72d271c9cc75c (patch)
tree4003b10b60e5e1a83a24d5800aefbe5e56c39da5
parent083ced83d71a6ab60204c7ada6c22d9c82731713 (diff)
downloadchrome-ec-138d51f1b93cb44eb93b0ea20cd72d271c9cc75c.tar.gz
helios: Fix battery discharge FET access config setting
The batteries for helios specified register 0x44 as the register address that contains the status of the discahrge FET. That is correct for the TI fuel gauge. However, address 0x44 is in the manufacturer access region and therfore .mfgacc_support field needs to be set. However, register 0x0 mirrors the lower 16 bits of mfgacc reg 0x44, so an alternate solution is to change the reg_addr field to 0x0 and keep the regular smart battery register access method. In addition, this CL also removes dependency on the charge FET for battery disconnect state as that really only depends on the discharge FET being active so the battery can supply power to the system. BUG=b:136970148 BRANCH=None TEST=Put helios in ship mode via 'cutoff' on EC console. Then after waiting 30 seconds apply external AC power. Verfied that the discharge FET is initially disabled, then gets enabled as the battery wakes up. 2019-11-08 14:48:54 [3.428296 Batt disconnected: reg 0x6301 2019-11-08 14:48:54 [3.428843 found battery in disconnect state] 2019-11-08 14:48:54 [3.678447 Batt disconnected: reg 0x6301 2019-11-08 14:48:54 [3.678995 found battery in disconnect state] 2019-11-08 14:48:55 [4.427645 charge_manager_leave_safe_mode()] 2019-11-08 14:48:55 [4.434650 Battery 99% (Display 100.0 %) / ??h:?? to full] Prior to this fix this register was reading back 0x16 always. Change-Id: I8fbcdeb55f692796ced034c3c95db94fafdc908e Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1906995 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
-rw-r--r--board/helios/battery.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/board/helios/battery.c b/board/helios/battery.c
index 234609b723..c7168caf8a 100644
--- a/board/helios/battery.c
+++ b/board/helios/battery.c
@@ -41,9 +41,9 @@ const struct board_batt_params board_battery_info[] = {
.reg_data = { 0x10, 0x10 },
},
.fet = {
- .reg_addr = 0x44,
- .reg_mask = 0x6000,
- .disconnect_val = 0x6000,
+ .reg_addr = 0x0,
+ .reg_mask = 0x2000,
+ .disconnect_val = 0x2000,
}
},
.batt_info = {
@@ -67,9 +67,9 @@ const struct board_batt_params board_battery_info[] = {
.reg_data = { 0x10, 0x10 },
},
.fet = {
- .reg_addr = 0x44,
- .reg_mask = 0x6000,
- .disconnect_val = 0x6000,
+ .reg_addr = 0x0,
+ .reg_mask = 0x2000,
+ .disconnect_val = 0x2000,
}
},
.batt_info = {