summaryrefslogtreecommitdiff
path: root/include/battery_fuel_gauge.h
diff options
context:
space:
mode:
authorpoornima tom <poornima.tom@intel.com>2021-10-12 02:24:58 +0530
committerCommit Bot <commit-bot@chromium.org>2022-01-07 20:26:38 +0000
commit8e2b0d8b64a590426c1035baf319674b6351ca64 (patch)
treee733b379ea4fb962c9a92985b34b75431e056710 /include/battery_fuel_gauge.h
parent5735ad28476fe9f8c36149094afc0c57c8c4a6be (diff)
downloadchrome-ec-8e2b0d8b64a590426c1035baf319674b6351ca64.tar.gz
config: Add CONFIG_BATTERY_NO_AUTO_DETECT option
There are some battery types which cannot be identified by normal manufacturing name or device name. For devices, which uses this type of batteries can be configured with CONFIG_BATTERY_NO_AUTO_DETECT to indicate the same. Based on this config, the idea is to set the correct battery type at runtime and then use the manufacturing or device name to identify the battery later. The motivation of this change is to have a single binary for multiple platforms that have different battery configuration. BUG=b:194163586 BRANCH=none TEST=make buildall -j Signed-off-by: poornima tom <poornima.tom@intel.com> Change-Id: I488ca3d72250311630724381a8cfeb52d8dad657 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3216893 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include/battery_fuel_gauge.h')
-rw-r--r--include/battery_fuel_gauge.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/battery_fuel_gauge.h b/include/battery_fuel_gauge.h
index eb54b64c53..7589a68190 100644
--- a/include/battery_fuel_gauge.h
+++ b/include/battery_fuel_gauge.h
@@ -14,6 +14,9 @@
/* Number of writes needed to invoke battery cutoff command */
#define SHIP_MODE_WRITES 2
+/* When battery type is not initialized */
+#define BATTERY_TYPE_UNINITIALIZED -1
+
struct ship_mode_info {
/*
* Write Block Support. If wb_support is true, then we use a i2c write
@@ -78,6 +81,15 @@ int battery_bq4050_imbalance_mv(void);
#endif
+#ifdef CONFIG_BATTERY_TYPE_NO_AUTO_DETECT
+/*
+ * Set the battery type, when auto-detection cannot be used.
+ *
+ * @param type Battery type
+ */
+void battery_set_fixed_battery_type(int type);
+#endif
+
/**
* Return the board-specific default battery type.
*