summaryrefslogtreecommitdiff
path: root/board/fennel
diff options
context:
space:
mode:
authorMike Lee <mike5@huaqin.corp-partner.google.com>2020-11-13 11:37:53 +0800
committerCommit Bot <commit-bot@chromium.org>2020-11-16 06:14:13 +0000
commita9e18a31f61999715c0cc16d4a2c8edfdbd16986 (patch)
tree13f56da1d532af78f88d959acf9c228904bea430 /board/fennel
parent7bb5568c04011aecdeda2e55a0ca69443d497e3b (diff)
downloadchrome-ec-a9e18a31f61999715c0cc16d4a2c8edfdbd16986.tar.gz
Fennel: disable keyboard at tablet mode when in S3
when in S3 and tablet mode, keyboard scan should be disabled and machine should not be waked up if user press keyboard BUG=b:173155379 BRANCH=firmware-kukui-12573.B TEST=put machine in tablet mode, use 'powerd_dbus_suspend' to let machine enter S3, press any key of keyboard cannot wake up machine Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I5e68d55e2d89aeab9b3920e3be520882c3b0e5bd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2537730 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Commit-Queue: Chen-Tsung Hsieh <chentsung@chromium.org>
Diffstat (limited to 'board/fennel')
-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