summaryrefslogtreecommitdiff
path: root/board/willow/board.c
diff options
context:
space:
mode:
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