summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2022-01-14 01:21:59 +0000
committerCommit Bot <commit-bot@chromium.org>2022-01-19 01:57:38 +0000
commit88904a9908324ac9b996df25a6b6f8bc33f3a580 (patch)
tree7a382a9ee257cd17c75f8a4332d4852b0cda45e2
parentf62cdb7feb9b23a1c716b9623ff7939041f0f25c (diff)
downloadchrome-ec-88904a9908324ac9b996df25a6b6f8bc33f3a580.tar.gz
zephyr: support CONFIG_CHARGER_RUNTIME_CONFIG
BUG=b:213996924 TEST=nivviks builds with runtime charger configuration enabled BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I9ba13e53db404df30e81c2f38f2e09b1f4670629 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3386974 Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
-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.