summaryrefslogtreecommitdiff
path: root/baseboard/zork/baseboard.c
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-06-19 14:15:21 -0600
committerCommit Bot <commit-bot@chromium.org>2020-06-20 01:58:57 +0000
commitf4a6e87bd1fcc7932fc4cba148b171c514b21a1c (patch)
tree553187b0a65582df345064deb1dd7e7e4e7f278f /baseboard/zork/baseboard.c
parent4736f8b3bc1771999883c0158be95418f05720ca (diff)
downloadchrome-ec-f4a6e87bd1fcc7932fc4cba148b171c514b21a1c.tar.gz
Zork: Don't KB_SCAN_DISABLE_LID_ANGLE in S0
Keep keyboard scan enabled in tablet mode if the AP is in S0, so AP can decide whether to ignore input devices or not. BUG=b:159456704 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I7e71e2b8d593732315caa73cf585e5d20e5eb9a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2254981 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'baseboard/zork/baseboard.c')
-rw-r--r--baseboard/zork/baseboard.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c
index c63b83cef1..2cdfa1d7e3 100644
--- a/baseboard/zork/baseboard.c
+++ b/baseboard/zork/baseboard.c
@@ -204,8 +204,23 @@ __overridable int board_get_temp(int idx, int *temp_k)
#ifndef TEST_BUILD
void lid_angle_peripheral_enable(int enable)
{
- if (ec_config_has_lid_angle_tablet_mode())
- keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE);
+ if (ec_config_has_lid_angle_tablet_mode()) {
+ 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