Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions common/charge_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,15 @@ int charge_request(bool use_curr, bool is_full)
*/
voltage = charger_closest_voltage(
curr.batt.voltage + charger_get_info()->voltage_step);
/* If the battery is full, request the max voltage. */
if (is_full)
/*
* If the battery is full, request the max voltage.
*
* Do the same when the sustainer is deliberately holding the
* battery at a charge limit. The intent in
* IDLE is the same as when full: hold, don't charge, and don't
* let the battery back-feed the system.
*/
if (is_full || get_chg_ctrl_mode() == CHARGE_CONTROL_IDLE)
voltage = battery_get_info()->voltage_max;
/* And handle dead battery case */
voltage = MAX(voltage, battery_get_info()->voltage_normal);
Expand Down