diff options
author | Jes Klinke <jbk@google.com> | 2020-06-11 14:49:43 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-12 02:01:44 +0000 |
commit | c29dcac009b642a9a46c6703e354cd5a9c1ba885 (patch) | |
tree | b1ecb931e23f1ea2bc47e6b175d883639d510c5a /board/terrador | |
parent | c7fea151a88925c8167d7ad788452cdca3635215 (diff) | |
download | chrome-ec-c29dcac009b642a9a46c6703e354cd5a9c1ba885.tar.gz |
volteer: Only disable keyscanning when not in S0.
Duplicate of: https://chromium-review.googlesource.com/1089823
We should find the source of the copy-pasting, and also fix that.
TEST=Flash volteer proto1 (ripto), open recovery firmware screen, verify that keypresses are recognized.
Change-Id: I8f4a9851446120a5a89c604fc00ecb6371eadc0f
Bug: b:157080964
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2242352
Tested-by: Jes Klinke <jbk@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Jes Klinke <jbk@chromium.org>
Diffstat (limited to 'board/terrador')
-rw-r--r-- | board/terrador/sensors.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/board/terrador/sensors.c b/board/terrador/sensors.c index 0a8b051699..9e34812131 100644 --- a/board/terrador/sensors.c +++ b/board/terrador/sensors.c @@ -228,14 +228,18 @@ DECLARE_HOOK(HOOK_INIT, baseboard_sensors_init, HOOK_PRIO_DEFAULT); #ifndef TEST_BUILD 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 |