summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/Kconfig.battery10
-rw-r--r--zephyr/shim/include/config_chip.h5
2 files changed, 15 insertions, 0 deletions
diff --git a/zephyr/Kconfig.battery b/zephyr/Kconfig.battery
index e1e0d703e1..fc428e8dc8 100644
--- a/zephyr/Kconfig.battery
+++ b/zephyr/Kconfig.battery
@@ -143,6 +143,16 @@ config PLATFORM_EC_OCPC
endchoice # PLATFORM_EC_CHARGER_TYPE
+config PLATFORM_EC_CHARGER_RUNTIME_CONFIG
+ bool "Allow charger configuration at runtime"
+ default n
+ help
+ When enabled, the internal array of charger chip configuration will
+ not be made constant. This allows board code to do runtime
+ reconfiguration, such as to configure ports that may only be present
+ in some hardware configurations or when ports in some configurations
+ are setup differently.
+
config PLATFORM_EC_CHARGE_MANAGER
bool "Charge manager"
default y
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 593bed5476..d6124ca7c2 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -271,6 +271,11 @@
#define CONFIG_CHARGER_SINGLE_CHIP
#endif
+#undef CONFIG_CHARGER_RUNTIME_CONFIG
+#ifdef CONFIG_PLATFORM_EC_CHARGER_RUNTIME_CONFIG
+#define CONFIG_CHARGER_RUNTIME_CONFIG
+#endif
+
/*
* Note - ISL9241 chargers for all channels are configured with the same
* switching frequency. Use the first ISL9241 instance found in the device tree.