diff options
author | Keith Short <keithshort@chromium.org> | 2020-09-29 16:16:00 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-01 20:09:00 +0000 |
commit | 9b4f53e42e7bfcb2d045eca422b0097cc309a8d2 (patch) | |
tree | c09e8e175355fad269f7339a157ec370e2e58070 /baseboard/volteer | |
parent | 480a1dc59a883251019262147a8c306e98599436 (diff) | |
download | chrome-ec-9b4f53e42e7bfcb2d045eca422b0097cc309a8d2.tar.gz |
volteer: Enable SW charge ramping
Enable CONFIG_CHARGE_RAMP_SW because hardware based charge ramping
doesn't work on the ISL9241.
BUG=b:169350714, b:168960587
BRANCH=none
TEST=make buildall
TEST=Connect 1.5A CDP device to Volteer and verify charge ramp from 0.5A
to 1.5A over about 7 seconds.
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I81e8a3913bd776d0d3fda6d294fdeabbde5df62a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2438912
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'baseboard/volteer')
-rw-r--r-- | baseboard/volteer/baseboard.c | 20 | ||||
-rw-r--r-- | baseboard/volteer/baseboard.h | 6 |
2 files changed, 25 insertions, 1 deletions
diff --git a/baseboard/volteer/baseboard.c b/baseboard/volteer/baseboard.c index 36bf4bed8e..c06306ec2c 100644 --- a/baseboard/volteer/baseboard.c +++ b/baseboard/volteer/baseboard.c @@ -8,6 +8,7 @@ #include "button.h" #include "cbi_ec_fw_config.h" #include "charge_manager.h" +#include "charge_ramp.h" #include "charge_state.h" #include "cros_board_info.h" #include "driver/charger/isl9241.h" @@ -357,3 +358,22 @@ static void cbi_init(void) board_cbi_init(); } DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_FIRST); + +/** + * Return if VBUS is too low + */ +int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state) +{ + int voltage; + + if (charger_get_vbus_voltage(port, &voltage)) + voltage = 0; + + /* + * For legacy BC1.2 charging with CONFIG_CHARGE_RAMP_SW, ramp up input + * current until voltage drops to the minimum input voltage of the + * charger, 4.096V. + */ + return voltage < ISL9241_BC12_MIN_VOLTAGE; +} + diff --git a/baseboard/volteer/baseboard.h b/baseboard/volteer/baseboard.h index 458bd7b300..d63c0062d5 100644 --- a/baseboard/volteer/baseboard.h +++ b/baseboard/volteer/baseboard.h @@ -102,10 +102,14 @@ /* Common charger defines */ #define CONFIG_CHARGE_MANAGER -#define CONFIG_CHARGE_RAMP_HW #define CONFIG_CHARGER #define CONFIG_CHARGER_DISCHARGE_ON_AC #define CONFIG_CHARGER_INPUT_CURRENT 512 + +/* + * Hardware based charge ramp is broken in the ISL9241 (b/169350714). + */ +#define CONFIG_CHARGE_RAMP_SW #define CONFIG_CHARGER_ISL9241 #define CONFIG_USB_CHARGER |