summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/willow/board.c21
-rw-r--r--board/willow/board.h1
2 files changed, 22 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
diff --git a/board/willow/board.h b/board/willow/board.h
index 7d70a98ca6..73f6c19b5f 100644
--- a/board/willow/board.h
+++ b/board/willow/board.h
@@ -58,6 +58,7 @@
#define CONFIG_CMD_ACCEL_INFO
#define CONFIG_LID_ANGLE
+#define CONFIG_LID_ANGLE_UPDATE
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL