Skip to content

Commit d413b14

Browse files
charge_state: keep VSYS above VBAT while the sustainer holds a limit
1 parent e0a4f22 commit d413b14

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

common/charge_state.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,15 @@ int charge_request(bool use_curr, bool is_full)
470470
*/
471471
voltage = charger_closest_voltage(
472472
curr.batt.voltage + charger_get_info()->voltage_step);
473-
/* If the battery is full, request the max voltage. */
474-
if (is_full)
473+
/*
474+
* If the battery is full, request the max voltage.
475+
*
476+
* Do the same when the sustainer is deliberately holding the
477+
* battery at a charge limit. The intent in
478+
* IDLE is the same as when full: hold, don't charge, and don't
479+
* let the battery back-feed the system.
480+
*/
481+
if (is_full || get_chg_ctrl_mode() == CHARGE_CONTROL_IDLE)
475482
voltage = battery_get_info()->voltage_max;
476483
/* And handle dead battery case */
477484
voltage = MAX(voltage, battery_get_info()->voltage_normal);

0 commit comments

Comments
 (0)