diff options
-rw-r--r-- | common/charge_manager.c | 15 | ||||
-rw-r--r-- | common/charge_state_v2.c | 15 |
2 files changed, 15 insertions, 15 deletions
diff --git a/common/charge_manager.c b/common/charge_manager.c index 88befb345f..12e76e0d4a 100644 --- a/common/charge_manager.c +++ b/common/charge_manager.c @@ -973,6 +973,21 @@ void charge_manager_leave_safe_mode(void) if (left_safe_mode) return; + /* + * Sometimes the fuel gauge will report that it has + * sufficient state of charge and remaining capacity, + * but in actuality it doesn't. When the EC sees that + * information, it trusts it and leaves charge manager + * safe mode. Doing so will allow CHARGE_PORT_NONE to + * be selected, thereby cutting off the input FETs. + * When the battery cannot provide the charge it claims, + * the system loses power, shuts down, and the battery + * is not charged even though the charger is plugged in. + * By waiting 500ms, we can avoid the selection of + * CHARGE_PORT_NONE around init time and not cut off the + * input FETs. + */ + msleep(500); CPRINTS("%s()", __func__); cflush(); left_safe_mode = 1; diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 25e1570505..084fd086d7 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -1935,21 +1935,6 @@ wait_for_it: if (curr.batt.state_of_charge >= CONFIG_CHARGE_MANAGER_BAT_PCT_SAFE_MODE_EXIT && !battery_seems_to_be_disconnected) { - /* - * Sometimes the fuel gauge will report that it has - * sufficient state of charge and remaining capacity, - * but in actuality it doesn't. When the EC sees that - * information, it trusts it and leaves charge manager - * safe mode. Doing so will allow CHARGE_PORT_NONE to - * be selected, thereby cutting off the input FETs. - * When the battery cannot provide the charge it claims, - * the system loses power, shuts down, and the battery - * is not charged even though the charger is plugged in. - * By waiting 500ms, we can avoid the selection of - * CHARGE_PORT_NONE around init time and not cut off the - * input FETs. - */ - msleep(500); charge_manager_leave_safe_mode(); } #endif |