@@ -261,18 +261,6 @@ int power_button_batt_cutoff(void)
261261 return power_button_battery_cutoff ;
262262}
263263
264- /**
265- * Check the plug-in AC then power on system setting.
266- */
267- bool ac_poweron_check (void )
268- {
269- uint8_t memcap ;
270-
271- system_get_bbram (SYSTEM_BBRAM_IDX_AC_BOOT , & memcap );
272-
273- return memcap ? true : false;
274- }
275-
276264/**
277265 * Power button state machine.
278266 *
@@ -396,9 +384,8 @@ static void state_machine(uint64_t tnow)
396384 tnext_state = tnow + PWRBTN_DELAY_INITIAL ;
397385 initial_delay -- ;
398386 } else {
399- if ((poweron_reason_powerbtn () || (system_get_reset_flags () &
400- EC_RESET_FLAG_HARD ) == EC_RESET_FLAG_HARD ) ||
401- (extpower_is_present () && ac_poweron_check ())) {
387+ if (poweron_reason_powerbtn () || poweron_reason_acin () ||
388+ ((system_get_reset_flags () & EC_RESET_FLAG_HARD ) == EC_RESET_FLAG_HARD )) {
402389
403390 reset_diagnostics ();
404391
@@ -429,8 +416,8 @@ static void state_machine(uint64_t tnow)
429416 * button until it's released, so that holding down the
430417 * recovery combination doesn't cause the chipset to shut back
431418 * down. */
432- if (poweron_reason_powerbtn () || ( system_get_reset_flags () &
433- EC_RESET_FLAG_HARD ) == EC_RESET_FLAG_HARD )
419+ if (poweron_reason_powerbtn () || poweron_reason_acin () ||
420+ (( system_get_reset_flags () & EC_RESET_FLAG_HARD ) == EC_RESET_FLAG_HARD ) )
434421 set_pwrbtn_to_pch (1 , 1 );
435422
436423 if (power_button_is_pressed ())
0 commit comments