diff options
Diffstat (limited to 'common/keyboard_scan.c')
-rw-r--r-- | common/keyboard_scan.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c index f5fb7542de..9de1dea614 100644 --- a/common/keyboard_scan.c +++ b/common/keyboard_scan.c @@ -19,6 +19,7 @@ #include "lid_switch.h" #include "switch.h" #include "system.h" +#include "tablet_mode.h" #include "task.h" #include "timer.h" #include "usb_api.h" @@ -702,6 +703,16 @@ void keyboard_scan_init(void) #ifdef CONFIG_HOSTCMD_EVENTS if (boot_key_value & BOOT_KEY_ESC) { host_set_single_event(EC_HOST_EVENT_KEYBOARD_RECOVERY); + /* + * In recovery mode, we should force clamshell mode in order to + * prevent the keyboard from being disabled unintentionally due + * to unstable accel readings. + * + * You get the same effect if motion sensors or a motion sense + * task are disabled in RO. + */ + if (IS_ENABLED(CONFIG_TABLET_MODE)) + tablet_disable(); if (boot_key_value & BOOT_KEY_LEFT_SHIFT) host_set_single_event( EC_HOST_EVENT_KEYBOARD_RECOVERY_HW_REINIT); |