diff --git a/board/bds/ec.tasklist b/board/bds/ec.tasklist index a17d39199f..5e2ec6459f 100644 --- a/board/bds/ec.tasklist +++ b/board/bds/ec.tasklist @@ -18,7 +18,6 @@ TASK(TEMPSENSOR, temp_sensor_task, NULL) \ TASK(KEYSCAN, keyboard_scan_task, NULL) \ TASK(POWERBTN, power_button_task, NULL) \ - TASK(X86POWER, x86_power_task, NULL) \ TASK(CONSOLE, console_task, NULL) \ TASK(HOSTCMD, host_command_task, NULL) \ TASK(I8042CMD, i8042_command_task, NULL) diff --git a/common/keyboard.c b/common/keyboard.c index d854e860b3..641ea9b91a 100644 --- a/common/keyboard.c +++ b/common/keyboard.c @@ -542,13 +542,16 @@ void keyboard_set_power_button(int pressed) power_button_pressed = pressed; - if (x86_power_in_S0()) { - code_set = acting_code_set(scancode_set); - ret = i8042_send_to_host( - (code_set == SCANCODE_SET_2 && !pressed) ? 3 : 2, - code[code_set - SCANCODE_SET_1][pressed]); - ASSERT(ret == EC_SUCCESS); - } +#ifdef CONFIG_TASK_X86POWER + /* Only send the scan code if x86 is fully awake */ + if (!x86_power_in_S0()) + return; +#endif + code_set = acting_code_set(scancode_set); + ret = i8042_send_to_host( + (code_set == SCANCODE_SET_2 && !pressed) ? 3 : 2, + code[code_set - SCANCODE_SET_1][pressed]); + ASSERT(ret == EC_SUCCESS); }