diff options
author | Wai-Hong Tam <waihong@google.com> | 2021-08-03 17:17:56 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-05 00:13:33 +0000 |
commit | 2eb53a39662b905c65015bafb5f73ab2324d369c (patch) | |
tree | 6352433557cdb05c75b1eef449c9ecf844bfc3d0 /board/nami | |
parent | fc016f2dce16d0555deee69e00ea5a626eb27f21 (diff) | |
download | chrome-ec-2eb53a39662b905c65015bafb5f73ab2324d369c.tar.gz |
lid_angle: Create a common callback for lid angle changes
Each board defines its own callback lid_angle_peripheral_enable().
The implementation is very similar. Create a common implementation
and reduce the duplicated code.
This CL removes the board callbacks which are identifical to the
common callback. If it is slightly different, keep it and add
the __override tag.
The check of TEST_BUILD is unnecessary as the board callback is not
linked in the test build.
BRANCH=None
BUG=b:194922043
TEST=Build all the images.
Change-Id: I73d381730f35b80eff69399cdfc5fb54f839aee0
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3069175
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/nami')
-rw-r--r-- | board/nami/board.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/board/nami/board.c b/board/nami/board.c index 27df3a1fe7..0dbd315f3a 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -852,8 +852,7 @@ struct motion_sensor_t motion_sensors[] = { unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); /* Enable or disable input devices, based on chipset state and tablet mode */ -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { /* If the lid is in 360 position, ignore the lid angle, * which might be faulty. Disable keyboard. @@ -862,7 +861,6 @@ void lid_angle_peripheral_enable(int enable) enable = 0; keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif /* Called on AP S3 -> S0 transition */ static void board_chipset_resume(void) |