diff options
Diffstat (limited to 'baseboard/zork/baseboard.c')
-rw-r--r-- | baseboard/zork/baseboard.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c index c63b83cef1..2cdfa1d7e3 100644 --- a/baseboard/zork/baseboard.c +++ b/baseboard/zork/baseboard.c @@ -204,8 +204,23 @@ __overridable int board_get_temp(int idx, int *temp_k) #ifndef TEST_BUILD void lid_angle_peripheral_enable(int enable) { - if (ec_config_has_lid_angle_tablet_mode()) - keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); + if (ec_config_has_lid_angle_tablet_mode()) { + int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); + + if (enable) { + keyboard_scan_enable(1, KB_SCAN_DISABLE_LID_ANGLE); + } else { + /* + * Ensure that the chipset is off before disabling the + * keyboard. When the chipset is on, the EC keeps the + * keyboard enabled and the AP decides whether to + * ignore input devices or not. + */ + if (!chipset_in_s0) + keyboard_scan_enable(0, + KB_SCAN_DISABLE_LID_ANGLE); + } + } } #endif |