From 88904a9908324ac9b996df25a6b6f8bc33f3a580 Mon Sep 17 00:00:00 2001 From: Peter Marheine Date: Fri, 14 Jan 2022 01:21:59 +0000 Subject: zephyr: support CONFIG_CHARGER_RUNTIME_CONFIG BUG=b:213996924 TEST=nivviks builds with runtime charger configuration enabled BRANCH=none Signed-off-by: Peter Marheine Change-Id: I9ba13e53db404df30e81c2f38f2e09b1f4670629 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3386974 Reviewed-by: Andrew McRae Reviewed-by: Jeremy Bettis --- zephyr/Kconfig.battery | 10 ++++++++++ zephyr/shim/include/config_chip.h | 5 +++++ 2 files changed, 15 insertions(+) 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. -- cgit v1.2.1