summaryrefslogtreecommitdiff
path: root/board/asurada
diff options
context:
space:
mode:
authorJes Klinke <jbk@google.com>2020-06-11 16:03:09 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-12 21:04:59 +0000
commitabf6b6e1d502101ccae25b500811d87925feaa2c (patch)
tree74b5bb80df71d29ba2f49710842263016eb490a3 /board/asurada
parentc8e36edc96360458dd29919e88a85a6749f1740b (diff)
downloadchrome-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/asurada')
-rw-r--r--board/asurada/board.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/board/asurada/board.c b/board/asurada/board.c
index d58ebb734d..a06dd6079a 100644
--- a/board/asurada/board.c
+++ b/board/asurada/board.c
@@ -437,14 +437,19 @@ __override uint8_t board_get_usb_pd_port_count(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;
- 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