Skip to content

Commit b06d3e8

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 <dhs@frame.work> (cherry picked from commit faf9842)
1 parent f89f6f1 commit b06d3e8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

zephyr/program/framework/src/power_button_x86.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,17 @@ static void set_initial_pwrbtn_state(void)
220220
(gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_on_off_btn_l)) == 1) &&
221221
!get_standalone_mode()) {
222222
pwrbtn_state = PWRBTN_STATE_IDLE;
223-
CPRINTS("PB ignore signal");
223+
CPRINTS("PB ignore signal - chassis open");
224224
return;
225225
}
226226

227+
#ifndef CONFIG_POWER_BUTTON_IGNORE_LID
228+
if (!lid_is_open()) {
229+
CPRINTS("PB ignore signal - lid closed");
230+
return;
231+
}
232+
#endif
233+
227234
/**
228235
* EC needs to auto power on after exiting the hibernate mode w/o external power
229236
*/

0 commit comments

Comments
 (0)