diff options
Diffstat (limited to 'board/lazor')
-rw-r--r-- | board/lazor/board.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/board/lazor/board.c b/board/lazor/board.c index 3d9b057a73..1df3ab4b6b 100644 --- a/board/lazor/board.c +++ b/board/lazor/board.c @@ -511,14 +511,18 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); /* This callback disables keyboard when convertibles are fully open */ void lid_angle_peripheral_enable(int enable) { - /* - * If the lid is in tablet position via other sensors, - * ignore the lid angle, which might be faulty then - * disable keyboard. - */ - if (tablet_get_mode()) - enable = 0; - - keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); + 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 |