summaryrefslogtreecommitdiff
path: root/include/battery_fuel_gauge.h
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-08-21 15:31:52 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-26 04:47:39 +0000
commite909c5a3f0b0c8f8fcba470878170f3d3195d9b1 (patch)
tree626cb360ee4f4d1da9439e3da0c35d8e42ce70d3 /include/battery_fuel_gauge.h
parentff52ee7e2da9dd76499007a6b541c3fdc093aa02 (diff)
downloadchrome-ec-e909c5a3f0b0c8f8fcba470878170f3d3195d9b1.tar.gz
battery_fuel_gauge: Add check for CFET status
This commit adds a function that allows the system to check the if the charge FET (CFET) is disabled or not. BUG=b:160918663 BRANCH=None TEST=Build and flash waddledee; cutoff battery, revive system, verify that "found batt in disconnect" statements are still found. TEST=Add other code, verify that CFET status is able to be retrieved. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I899070e50a38499708a367bba6b5f502b0232672 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2368071 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include/battery_fuel_gauge.h')
-rw-r--r--include/battery_fuel_gauge.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/battery_fuel_gauge.h b/include/battery_fuel_gauge.h
index d610b7e417..8b1b7106bd 100644
--- a/include/battery_fuel_gauge.h
+++ b/include/battery_fuel_gauge.h
@@ -30,6 +30,8 @@ struct fet_info {
const uint8_t reg_addr;
const uint16_t reg_mask;
const uint16_t disconnect_val;
+ const uint16_t cfet_mask; /* CHG FET status mask */
+ const uint16_t cfet_off_val;
};
struct fuel_gauge_info {
@@ -69,6 +71,12 @@ int battery_bq4050_imbalance_mv(void);
#endif
/**
+ * Return 1 if CFET is disabled, 0 if enabled. -1 if an error was encountered.
+ * If the CFET mask is not defined, it will return 0.
+ */
+int battery_is_charge_fet_disabled(void);
+
+/**
* Battery cut off command via SMBus write block.
*
* @param ship_mode Battery ship mode information