summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/charger/bq25710.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/driver/charger/bq25710.c b/driver/charger/bq25710.c
index c4035d2f1b..9df085d78f 100644
--- a/driver/charger/bq25710.c
+++ b/driver/charger/bq25710.c
@@ -490,10 +490,12 @@ int charger_set_hw_ramp(int enable)
if (enable) {
/*
* ICO mode can only be used when a battery is present. If there
- * is no battery, then enabling ICO mode will lead to VSYS
+ * is no battery, or if the battery has not recovered yet from
+ * cutoff, then enabling ICO mode will lead to VSYS
* dropping out.
*/
- if (!battery_is_present()) {
+ if (!battery_is_present() || (battery_get_disconnect_state() !=
+ BATTERY_NOT_DISCONNECTED)) {
CPRINTF("bq25710: no battery, skip ICO enable\n");
return EC_ERROR_UNKNOWN;
}