diff options
author | Jes Klinke <jbk@google.com> | 2020-06-11 16:03:09 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-12 21:04:59 +0000 |
commit | abf6b6e1d502101ccae25b500811d87925feaa2c (patch) | |
tree | 74b5bb80df71d29ba2f49710842263016eb490a3 /board/yorp | |
parent | c8e36edc96360458dd29919e88a85a6749f1740b (diff) | |
download | chrome-ec-abf6b6e1d502101ccae25b500811d87925feaa2c.tar.gz |
asurada/lazor/voxel/yorp: Only disable keyscanning when not in S0.
Duplicate of: https://chromium-review.googlesource.com/1089823
for remaining boards not covered by
https://chromium-review.googlesource.com/2242352
BUG=b:158792057
TEST=make -j buildall
BRANCH=asurada,octopus
Change-Id: Ic3ae36629d75ff20e96910c107e67f933fa4cce5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2242396
Commit-Queue: Jes Klinke <jbk@chromium.org>
Tested-by: Jes Klinke <jbk@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/yorp')
-rw-r--r-- | board/yorp/board.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/board/yorp/board.c b/board/yorp/board.c index 0afa7ec06d..d080b8d446 100644 --- a/board/yorp/board.c +++ b/board/yorp/board.c @@ -214,15 +214,19 @@ void board_hibernate_late(void) { /* 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; + int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); - keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); + 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); + } } |