power: Remove last AC check from power_set_limit

Unconditionally set the power limit based on the current AC state when
power_set_limit is called. The contional logic to run it only on ACIN#
state change is already done in power_event.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2023-03-10 08:32:05 -07:00
committed by Jeremy Soller
parent a198289695
commit 568fae6aba

View File

@@ -327,16 +327,9 @@ static bool power_peci_limit(bool ac) {
// Set the power draw limit depending on if on AC or DC power
void power_set_limit(void) {
static bool last_power_limit_ac = true;
if (peci_available()) {
bool ac = !gpio_get(&ACIN_N);
if (last_power_limit_ac != ac) {
if (power_peci_limit(ac)) {
last_power_limit_ac = ac;
}
}
} else {
last_power_limit_ac = true;
power_peci_limit(ac);
}
}
#else // HAVE_DGPU