diff options
author | Simon Glass <sjg@chromium.org> | 2021-03-27 15:16:20 +1300 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-01 05:50:43 +0000 |
commit | ed6fede233ecc7c976d99a0c402e34f73215e1f9 (patch) | |
tree | 65120bd7da98354affe21f8e90a46cb62f07849d /zephyr/Kconfig.battery | |
parent | bfd3e5a9bf19e2066ad58f36f7dd9248cdf0b930 (diff) | |
download | chrome-ec-ed6fede233ecc7c976d99a0c402e34f73215e1f9.tar.gz |
zephyr: Add support for discharge testing
Add support for CHARGER_DISCHARGE_ON_AC and a choice for which method
to use to implement it. This does not seem to be all that common, so
leave it to default to off.
Drop the existing hard-coded setting. This option is often implemented
by the charger but the board should still select whether to use it or
not as there may be multiple chargers.
Enable it for volteer to keep things the same there.
BUG=b:183296099, b:175881762
BRANCH=none
TEST=with other CLs, build zephyr for lazor and see that the option is
present
check volteer still has the option enabled
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I8b893441d7e780ff74de7778c294a3e712ed1f62
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2788831
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/Kconfig.battery')
-rw-r--r-- | zephyr/Kconfig.battery | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/zephyr/Kconfig.battery b/zephyr/Kconfig.battery index 136710ee17..a7ad8d74aa 100644 --- a/zephyr/Kconfig.battery +++ b/zephyr/Kconfig.battery @@ -163,6 +163,47 @@ config PLATFORM_EC_CHARGER_BQ25720 endchoice # "Charger select" +config PLATFORM_EC_CHARGER_DISCHARGE_ON_AC + bool "Board supports discharge mode" + help + Enable this if the board supports discharging the battery even when + AC power is present. This is used for testing. The function is + provided either by the charger or by custom code in the board. + +if PLATFORM_EC_CHARGER_DISCHARGE_ON_AC + +choice "Discharge control method" + prompt "Select the method of controlling discharge" + help + Select which method is provided to enable and disable the discharge + mode. + +config PLATFORM_EC_CHARGER_DISCHARGE_ON_AC_CHARGER + bool "Charger controls discharge mode" + help + Enable this if the charger controls selection of discharge mode. + In this case the charger must provide a function: + + int charger_discharge_on_ac(int enabled) + + It should enable this feature if enabled is true, else disable it. + The function should return EC_SUCCESS + +config PLATFORM_EC_CHARGER_DISCHARGE_ON_AC_CUSTOM + bool "Custom control of discharge mode" + help + Enable this if the discharge mode is controlled by a custom function. + This function is typically provided by the board implementation: + + int board_discharge_on_ac(int enabled) + + It should enable this feature if enabled is true, else disable it. + The function should return EC_SUCCESS + +endchoice # "Discharge control method" + +endif # PLATFORM_EC_CHARGER_DISCHARGE_ON_AC + config PLATFORM_EC_CHARGER_NARROW_VDC bool help |