summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2018-06-06 17:48:23 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-06-11 19:42:38 +0000
commit2c3033bf911c22e5ba4a09b3b01329d41ab0d082 (patch)
tree2fd0e601d89e4b8c8cf2b94a155784a6f830dfbb
parentaa77a8c5ecd554b55c86be2f3f17d8afc490efd4 (diff)
downloadchrome-ec-2c3033bf911c22e5ba4a09b3b01329d41ab0d082.tar.gz
nautilus: Only disable keyscanning when not in S0.
Devices should not disable keyboard scanning when the chipset is in S0. Thy should keep the keyboard enabled and continue to forward the keys to the AP such that the AP can make the decision whether to ignore them or not. BUG=b:79670788 BRANCH=poppy TEST=Flash nautilus; Connect external display, reduce brightness on internal display to make external display the primary display; Enter tablet mode, verify that keyboard presses still show up in the UI. Change-Id: I452299726c6e8b388eb1061c23bed013228c2a2c Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/1089823 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/nautilus/board.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/board/nautilus/board.c b/board/nautilus/board.c
index b47774330b..834496cb99 100644
--- a/board/nautilus/board.c
+++ b/board/nautilus/board.c
@@ -700,12 +700,19 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
#ifndef TEST_BUILD
void lid_angle_peripheral_enable(int enable)
{
- /* If the lid is in 360 position, ignore the lid angle,
- * which might be faulty. Disable keyboard.
- */
- if (tablet_get_mode() || chipset_in_state(CHIPSET_STATE_ANY_OFF))
- 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