summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/fennel/board.c13
-rw-r--r--board/fennel/board.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/board/fennel/board.c b/board/fennel/board.c
index 799255712d..6a3980d6a8 100644
--- a/board/fennel/board.c
+++ b/board/fennel/board.c
@@ -544,3 +544,16 @@ DECLARE_HOST_COMMAND(EC_CMD_PWM_GET_DUTY,
host_command_pwm_get_duty,
EC_VER_MASK(0));
#endif
+
+/* Enable or disable input devices, based on chipset state and tablet mode */
+#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);
+}
+#endif
diff --git a/board/fennel/board.h b/board/fennel/board.h
index aaf863206a..3995435de1 100644
--- a/board/fennel/board.h
+++ b/board/fennel/board.h
@@ -61,6 +61,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