diff options
author | Ting Shen <phoenixshen@google.com> | 2020-06-03 14:15:07 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-05 11:24:36 +0000 |
commit | 8432637e62220c5eeb237f14ae1f7cd4e8a7ce84 (patch) | |
tree | 597fce723549a257c4d02093afae2e1c15bb17be | |
parent | dbdcf83655d83f0b6809fd47d9aaf0c667e2c812 (diff) | |
download | chrome-ec-8432637e62220c5eeb237f14ae1f7cd4e8a7ce84.tar.gz |
asurada: enable lid angle calculation
BUG=b:150341271
TEST=`accelread on`, verify the value looks reasonable
BRANCH=none
Signed-off-by: Ting Shen <phoenixshen@google.com>
Change-Id: I03bf63d95abba2c713ec6094dd3ba3e9ba6d4738
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2228079
Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Tested-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r-- | board/asurada/board.c | 16 | ||||
-rw-r--r-- | board/asurada/board.h | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/board/asurada/board.c b/board/asurada/board.c index 6db0d18ae2..06c72804c8 100644 --- a/board/asurada/board.c +++ b/board/asurada/board.c @@ -375,6 +375,22 @@ __override uint8_t board_get_usb_pd_port_count(void) return CONFIG_USB_PD_PORT_MAX_COUNT - 1; } +/* Lid */ +#ifndef TEST_BUILD +/* This callback disables keyboard when convertibles are fully open */ +void lid_angle_peripheral_enable(int enable) +{ + /* + * If the lid is in tablet position via other sensors, + * ignore the lid angle, which might be faulty then + * disable keyboard. + */ + if (tablet_get_mode()) + enable = 0; + keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); +} +#endif + /* Sensor */ static struct mutex g_base_mutex; diff --git a/board/asurada/board.h b/board/asurada/board.h index eb115a34bb..6b56ed860b 100644 --- a/board/asurada/board.h +++ b/board/asurada/board.h @@ -119,6 +119,11 @@ #define CONFIG_ACCEL_LIS2DW12_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(LID_ACCEL) +#define CONFIG_LID_ANGLE +#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL +#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL +#define CONFIG_LID_ANGLE_UPDATE + #define CONFIG_CMD_ACCEL_INFO #define CONFIG_CMD_ACCELS |