charge_state_v2: Wake charger task when we start/stop providing power
BRANCH=none
TEST=On wand, battery information is quickly updated after
(un)pluging AC on lid (otherwise we might have to wait up to
60 seconds).
@@ -1319,6 +1319,11 @@ int charge_set_output_current_limit(int ma, int mv)
if (ret != EC_SUCCESS)
return ret;
+ /* If we start/stop providing power, wake the charger task. */
+ if ((curr.output_current == 0 && enable) ||
+ (curr.output_current > 0 && !enable))
+ task_wake(TASK_ID_CHARGER);
+
curr.output_current = ma;
return EC_SUCCESS;
