summaryrefslogtreecommitdiff
path: root/common/power_button_x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/power_button_x86.c')
-rw-r--r--common/power_button_x86.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/power_button_x86.c b/common/power_button_x86.c
index bccf9c9c11..e6bdde38bc 100644
--- a/common/power_button_x86.c
+++ b/common/power_button_x86.c
@@ -321,6 +321,16 @@ static void state_machine(uint64_t tnow)
* battery is handled inside set_pwrbtn_to_pch().
*/
chipset_exit_hard_off();
+#ifdef CONFIG_DELAY_DSW_PWROK_TO_PWRBTN
+ /* Check if power button is ready. If not, we'll come back. */
+ if (get_time().val - get_time_dsw_pwrok() <
+ CONFIG_DSW_PWROK_TO_PWRBTN_US) {
+ tnext_state = get_time_dsw_pwrok() +
+ CONFIG_DSW_PWROK_TO_PWRBTN_US;
+ break;
+ }
+#endif
+
set_pwrbtn_to_pch(0, 1);
tnext_state = get_time().val + PWRBTN_INITIAL_US;