Skip to content

Commit cb82597

Browse files
Merge pull request #1046 from FrameworkComputer/azalea.power_btn_init
azalea:modify the power button initial behavior
2 parents b4c1fb8 + 9e27117 commit cb82597

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

zephyr/program/lotus/azalea/src/power_button_x86.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,18 @@ static void set_initial_pwrbtn_state(void)
212212
CPRINTS("PB init-on after updating firmware");
213213
} else if (((reset_flags & EC_RESET_FLAG_HIBERNATE) == EC_RESET_FLAG_HIBERNATE) &&
214214
(gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_hw_acav_in)) == 0)) {
215+
/**
216+
* If EC wake from power button and the power button already release.
217+
* check the chassis status and standalone mode status.
218+
*/
219+
if ((gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_chassis_open_l)) == 0) &&
220+
(gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_on_off_btn_l)) == 1) &&
221+
!get_standalone_mode()) {
222+
pwrbtn_state = PWRBTN_STATE_IDLE;
223+
CPRINTS("PB ignore signal");
224+
return;
225+
}
226+
215227
/**
216228
* EC needs to auto power on after exiting the hibernate mode w/o external power
217229
*/
@@ -439,7 +451,7 @@ static void powerbtn_x86_init(void)
439451
{
440452
set_initial_pwrbtn_state();
441453
}
442-
DECLARE_HOOK(HOOK_INIT, powerbtn_x86_init, HOOK_PRIO_DEFAULT + 1);
454+
DECLARE_HOOK(HOOK_INIT, powerbtn_x86_init, HOOK_PRIO_DEFAULT + 2);
443455

444456
void chipset_power_on(void)
445457
{

0 commit comments

Comments
 (0)