summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-01-17 14:16:47 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2017-01-19 19:28:27 +0000
commitd84646ce06357b18a4adb79a6f594f848cb9d6bd (patch)
treeea69301845e23036ecac11df086428c441ad7503
parentea65ceaf7fe3af9f76b3f8acb78d939bd33ad2aa (diff)
downloadchrome-ec-d84646ce06357b18a4adb79a6f594f848cb9d6bd.tar.gz
elm: hana: oak: Don't disable peripherals in S0.
When the device is in S0, the EC should not disable the peripherals; it should be up to the AP to decide whether or not to ignore these input devices. BUG=chrome-os-partner:61871 BRANCH=oak TEST=Flash oak; verify that keyscanning is not disabled in tablet mode when the system is in S0. Change-Id: Ia80afdc523c4c3fcd707792c2757931ca55a0061 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/428553 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/elm/board.c19
-rw-r--r--board/oak/board.c14
2 files changed, 29 insertions, 4 deletions
diff --git a/board/elm/board.c b/board/elm/board.c
index 1f8de54def..3b4ec456ff 100644
--- a/board/elm/board.c
+++ b/board/elm/board.c
@@ -637,10 +637,23 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
void lid_angle_peripheral_enable(int enable)
{
- keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE);
+ int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON);
- /* enable/disable touchpad */
- gpio_set_level(GPIO_EN_TP_INT_L, !enable);
+ if (enable) {
+ keyboard_scan_enable(1, KB_SCAN_DISABLE_LID_ANGLE);
+ gpio_set_level(GPIO_EN_TP_INT_L, 0);
+ } 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);
+ /* Disable trackpad interrupts. */
+ gpio_set_level(GPIO_EN_TP_INT_L, 1);
+ }
+ }
}
#endif /* defined(HAS_TASK_MOTIONSENSE) */
diff --git a/board/oak/board.c b/board/oak/board.c
index d9fca71b6c..f00d1ac03c 100644
--- a/board/oak/board.c
+++ b/board/oak/board.c
@@ -781,6 +781,18 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
void lid_angle_peripheral_enable(int enable)
{
- 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 /* defined(HAS_TASK_MOTIONSENSE) */