Skip to content

Commit b0fc051

Browse files
JohnAZoidbergquinchou77
authored andcommitted
fwk: Fix ignoring power button when lid is closed from G3
BRANCH=fwk-main BUG=Found after merging new upstream code and using new chroot, I guess the new compiler has a better warning/error BUG=637d4d5bc00756eb02c206dd529168d3758e5648 TEST=Close the lid and press the power button, the system should not react. You might have to pretend closing the lid by using a magnet or ec console `lidclose` Signed-off-by: Daniel Schaefer <[email protected]> (cherry picked from commit faf98422c39b730d3ffa06194919de3375d52adf)
1 parent 73e008b commit b0fc051

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

zephyr/program/framework/src/power_button_x86.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static void power_button_debounce_deferred(void)
210210
* Power button already release ignore PB signal
211211
*/
212212
pwrbtn_state = PWRBTN_STATE_IDLE;
213-
CPRINTS("PB debounce ignore signal");
213+
CPRINTS("PB ignore signal - debounce");
214214
} else {
215215
/**
216216
* Power button is still pressed, power on the system
@@ -241,17 +241,18 @@ static void set_initial_pwrbtn_state(void)
241241
(gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_on_off_btn_l)) == 1) &&
242242
!get_standalone_mode()) {
243243
pwrbtn_state = PWRBTN_STATE_IDLE;
244-
CPRINTS("PB ignore signal");
244+
CPRINTS("PB ignore signal - chassis open");
245245
return;
246246
}
247247

248248
/* On Framework 12 we want to ignore the power button in this case anyways,
249249
* if AC is not connected.
250250
*/
251251
#if !defined(CONFIG_POWER_BUTTON_IGNORE_LID) || CONFIG_PLATFORM_EC_FRAMEWORK_LAPTOP_12
252-
if (!lid_is_open())
252+
if (!lid_is_open()) {
253253
CPRINTS("PB ignore signal - lid closed");
254254
return;
255+
}
255256
#endif
256257

257258
/**

0 commit comments

Comments
 (0)