From 568fae6aba988092df71fa19e068e805f917a5a6 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Fri, 10 Mar 2023 08:32:05 -0700 Subject: [PATCH] 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 --- src/board/system76/common/power.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/board/system76/common/power.c b/src/board/system76/common/power.c index ae263fb..dfc8b02 100644 --- a/src/board/system76/common/power.c +++ b/src/board/system76/common/power.c @@ -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