diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-21 16:35:12 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-24 01:37:31 +0000 |
commit | ee1449f03969c04e255e394ec07a3ebf3bc3d6e8 (patch) | |
tree | 14377488bae05f14034857980c21a34f21b7c227 | |
parent | fca75f573ff913a5be050c7a13e7dcda6be68da2 (diff) | |
download | chrome-ec-ee1449f03969c04e255e394ec07a3ebf3bc3d6e8.tar.gz |
zephyr: Enable building of the battery fuel gauge
Bring in this file needed for monitoring a battery.
BUG=b:175248556
BRANCH=none
TEST=build and run zephyr on volteer
No visible change, except more code is compiled in
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I49a3960c62153ad0ea5c5f8121d0aa0d35e7ffe4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600228
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | zephyr/CMakeLists.txt | 2 | ||||
-rw-r--r-- | zephyr/Kconfig.battery | 8 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 8 |
3 files changed, 17 insertions, 1 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index efbcbd4323..3ebd40a187 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -45,6 +45,8 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC "${PLATFORM_EC}/common/base32.c" # Now include files that depend on or relate to other CONFIG options, sorted by # CONFIG zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY "${PLATFORM_EC}/common/battery.c") +zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE + "${PLATFORM_EC}/common/battery_fuel_gauge.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY_SMART "${PLATFORM_EC}/driver/battery/smart.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_ISL9241 diff --git a/zephyr/Kconfig.battery b/zephyr/Kconfig.battery index 3bcb88d111..c81001dd93 100644 --- a/zephyr/Kconfig.battery +++ b/zephyr/Kconfig.battery @@ -81,4 +81,12 @@ config PLATFORM_EC_CHARGER_ISL9241 endchoice +config PLATFORM_EC_BATTERY_FUEL_GAUGE + bool "Board supplies battery info" + help + The fuel gauge information is used to cut off the battery for shipping + mode and to check the charge/discharge FET status. The battery + information is used to set voltage, current and temperature operating + limits for the battery. + endif # PLATFORM_EC_BATTERY diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 69b7684a75..fba6b07847 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -32,7 +32,13 @@ #ifdef CONFIG_PLATFORM_EC_BATTERY #define CONFIG_BATTERY #define CONFIG_BATTERY_FUEL_GAUGE -#endif + +/* TODO(b/176121284): hard-coded for volteer */ +enum battery_type { + BATTERY_LGC011, + BATTERY_TYPE_COUNT, +}; +#endif /* CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE */ #undef CONFIG_BATTERY_SMART #ifdef CONFIG_PLATFORM_EC_BATTERY_SMART |