summaryrefslogtreecommitdiff
path: root/board/willow/board.c
diff options
context:
space:
mode:
authorDavid Huang <david.huang@quanta.corp-partner.google.com>2020-11-02 10:07:36 +0800
committerCommit Bot <commit-bot@chromium.org>2020-11-12 10:18:21 +0000
commit0005dba3110de2a9c3fd2b41d62539d46020805c (patch)
tree42696378312335203e0e9117e162539b33f047a2 /board/willow/board.c
parente32ef79d5229489e9ed824d9ea164c915587b3cf (diff)
downloadchrome-ec-0005dba3110de2a9c3fd2b41d62539d46020805c.tar.gz
willow: add CONFIG_LID_ANGLE_UPDATE
Add CONFIG_LID_ABGLE_UPDATE to control the touchpad and keyboard wakeup function. BUG=b:172034762 BRANCH=master TEST=Test the keyboard and touchpad wakeup when lid angle < 180 or lid angle > 180. Change-Id: I1909393222e040b375365d38a7a6f253cb150ea2 Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2531770 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'board/willow/board.c')
-rw-r--r--board/willow/board.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/board/willow/board.c b/board/willow/board.c
index 17ccb305e0..f672da2ad3 100644
--- a/board/willow/board.c
+++ b/board/willow/board.c
@@ -446,3 +446,24 @@ int board_get_battery_i2c(void)
{
return board_get_version() >= 1 ? 2 : 1;
}
+
+#ifndef TEST_BUILD
+void lid_angle_peripheral_enable(int enable)
+{
+ 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