diff options
author | Paul Ma <magf@bitland.corp-partner.google.com> | 2020-07-07 17:19:33 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-08 10:06:12 +0000 |
commit | 513edca98eb7edacb1182f112bdc52cc519bbe16 (patch) | |
tree | af1a09d14a439aa798e863a2c335c46840407a89 /board/damu | |
parent | 8d2511c1cb49ae7de7aaad1f640bb5e32572afae (diff) | |
download | chrome-ec-513edca98eb7edacb1182f112bdc52cc519bbe16.tar.gz |
damu: 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:160557015
BRANCH=kukui
TEST=put machine in tablet mode, use 'powerd_dbus_suspend' to
let machine enter S3, press any key of keyboard will not
wake up the machine.
Change-Id: If98e01e512b040b7e45e40b6064cbdae5b39944e
Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2284510
Reviewed-by: Li-jen Chen <lijen@google.com>
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'board/damu')
-rw-r--r-- | board/damu/board.c | 13 | ||||
-rw-r--r-- | board/damu/board.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/board/damu/board.c b/board/damu/board.c index 9b13dd0411..244b9b933c 100644 --- a/board/damu/board.c +++ b/board/damu/board.c @@ -454,3 +454,16 @@ int board_get_charger_i2c(void) /* TODO(b:138415463): confirm the bus allocation for future builds */ return board_get_version() == 1 ? 2 : 1; } + +/* 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/damu/board.h b/board/damu/board.h index df867a17ad..dfad8cbfac 100644 --- a/board/damu/board.h +++ b/board/damu/board.h @@ -63,6 +63,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 |