summaryrefslogtreecommitdiff
path: root/zephyr/Kconfig.battery
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-22 10:03:53 +1300
committerCommit Bot <commit-bot@chromium.org>2021-03-23 01:06:27 +0000
commit3da3c7a483bf62ca133f10a106d17f8666a0f1ae (patch)
tree879b86363f9d324956df02fddd1a91c45971384b /zephyr/Kconfig.battery
parent1b99ed4133a6ee618345353fe08a695a8806b382 (diff)
downloadchrome-ec-3da3c7a483bf62ca133f10a106d17f8666a0f1ae.tar.gz
zephyr: Add support for hardware charge-ramping
Allow this option to be selected, turning it into a choice between the two options. Make hardware ramping the default since it seems to be preferred. It was apparently not supported on volteer only due to a bug in the charger chip. Also move the software-ramp requirement for ISL9241 to Kconfig. We cannot 'select' a choice item like PLATFORM_EC_CHARGE_RAMP_SW in PLATFORM_EC_CHARGER_ISL9241, so use a 'depends on' instead. Update volteer to use software ramping since the default has changed. BUG=b:183296099 BRANCH=none TEST=build zephyr for lazor build for volteer and check that CONFIG_PLATFORM_EC_CHARGE_RAMP_SW=y Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ic3ffd21cd10aa896a4c6dbe1d98d75776c89aefe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774917 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/Kconfig.battery')
-rw-r--r--zephyr/Kconfig.battery32
1 files changed, 31 insertions, 1 deletions
diff --git a/zephyr/Kconfig.battery b/zephyr/Kconfig.battery
index d14c11e61c..3cfebbb129 100644
--- a/zephyr/Kconfig.battery
+++ b/zephyr/Kconfig.battery
@@ -95,6 +95,8 @@ config PLATFORM_EC_CHARGER_ISL9238
config PLATFORM_EC_CHARGER_ISL9241
bool "Use the ISL9241 charger"
depends on PLATFORM_EC_I2C
+ # Hardware based charge ramp is broken in the ISL9241 (b/169350714)
+ select PLATFORM_EC_CHARGER_CHGRAMP_BROKEN
help
Enables a driver for the ISL9241 VCD Battery Charger. This is a
digitally-configurable, buck-boost battery charger that can support
@@ -127,9 +129,35 @@ config PLATFORM_EC_BATTERY_FUEL_GAUGE
information is used to set voltage, current and temperature operating
limits for the battery.
+config PLATFORM_EC_CHARGER_CHGRAMP_BROKEN
+ bool
+ help
+ This is selected if the charger's support for hardware-controlled
+ charge ramping is broken. In some cases the charger has problems
+ which make it unusable and we must fall back to software-controlled
+ charge ramping.
+
+ This should be enabled by charger drivers which need it. It cannot
+ be set otherwise, even in prj.conf
+
+choice "Charge-ramp method"
+ prompt "Select the charge-ramp method"
+ help
+ Select the method used for ramping up charging of a battery. It is
+ preferred to use the hardware method if the charger chip can support
+ it. If not, software-controlled charging can be used, with a slight
+ increase in code size.
+
+config PLATFORM_EC_CHARGE_RAMP_HW
+ bool "Hardware-controlled charging"
+ depends on !PLATFORM_EC_CHARGER_CHGRAMP_BROKEN
+ help
+ Disables software control of ramping up charging. This is used when
+ the hardware has a a mechanism for ramping input current and
+ backing-off as needed.
+
config PLATFORM_EC_CHARGE_RAMP_SW
bool "Software-controlled charging"
- default y
select HAS_TASK_CHG_RAMP
help
Enables ramping up charging from an external source to the maximum
@@ -137,6 +165,8 @@ config PLATFORM_EC_CHARGE_RAMP_SW
current needs of the device. It handles the user plugging chargers in
and removing them.
+endchoice # "Charge-ramp method"
+
config PLATFORM_EC_CONSOLE_CMD_CHGRAMP
bool "Console command: chgramp"
depends on PLATFORM_EC_CHARGE_RAMP_SW