summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2020-10-16 18:22:01 +0800
committerCommit Bot <commit-bot@chromium.org>2020-10-20 03:46:23 +0000
commit84d652d98788bde9adfc9f81da3d28821cd5f307 (patch)
tree92c9b35d740be40f8d7e15e141af173c80257ec0
parent14dbee0eb462668b1d068a1d26a50bb6df29ebcb (diff)
downloadchrome-ec-84d652d98788bde9adfc9f81da3d28821cd5f307.tar.gz
burnet: Disable keyboard with tablet mode on S3
BUG=none BRANCH=firmware-kukui-12573.B TEST=On Burnet. Make sure keyboard don't wake up AP from suspend on tablet mode. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I68030c23d27375f320f1b559900ac832752981ad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2479063 Reviewed-by: Ting Shen <phoenixshen@chromium.org> (cherry picked from commit e1d70859fa3543c5ae5b4bed820aca2ca277ea17) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2484108 Commit-Queue: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--board/burnet/board.c13
-rw-r--r--board/burnet/board.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/board/burnet/board.c b/board/burnet/board.c
index a9555ce95d..bf9afa354d 100644
--- a/board/burnet/board.c
+++ b/board/burnet/board.c
@@ -470,3 +470,16 @@ int battery_set_vendor_param(uint32_t param, uint32_t value)
{
return EC_ERROR_UNIMPLEMENTED;
}
+
+/* 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/burnet/board.h b/board/burnet/board.h
index 898beb058b..c8311d363f 100644
--- a/board/burnet/board.h
+++ b/board/burnet/board.h
@@ -56,6 +56,7 @@
#define CONFIG_DYNAMIC_MOTION_SENSOR_COUNT
#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