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 | |
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')
61 files changed, 43 insertions, 523 deletions
diff --git a/board/ampton/board.c b/board/ampton/board.c index 5da4b2635b..3c88e22a74 100644 --- a/board/ampton/board.c +++ b/board/ampton/board.c @@ -374,9 +374,8 @@ void board_overcurrent_event(int port, int is_overcurrented) cprints(CC_USBPD, "p%d: overcurrent!", port); } -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { /* * If the lid is in tablet position via other sensors, @@ -388,4 +387,3 @@ void lid_angle_peripheral_enable(int enable) if (board_is_convertible()) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif diff --git a/board/bloog/board.c b/board/bloog/board.c index 7d62fdcf29..99ee87c080 100644 --- a/board/bloog/board.c +++ b/board/bloog/board.c @@ -280,9 +280,8 @@ void board_hibernate_late(void) gpio_set_flags(hibernate_pins[i][0], hibernate_pins[i][1]); } -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { /* * If the lid is in tablet position via other sensors, @@ -295,7 +294,6 @@ void lid_angle_peripheral_enable(int enable) if (board_is_convertible()) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif #ifdef CONFIG_KEYBOARD_FACTORY_TEST /* diff --git a/board/bobba/board.c b/board/bobba/board.c index ede3e2aa52..fa56f996b8 100644 --- a/board/bobba/board.c +++ b/board/bobba/board.c @@ -505,9 +505,8 @@ void board_hibernate_late(void) { gpio_set_flags(hibernate_pins[i][0], hibernate_pins[i][1]); } -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { /* * If the lid is in tablet position via other sensors, @@ -519,7 +518,6 @@ void lid_angle_peripheral_enable(int enable) if (board_is_convertible()) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif void board_overcurrent_event(int port, int is_overcurrented) { diff --git a/board/boldar/sensors.c b/board/boldar/sensors.c index 2bd91813ba..25fab11549 100644 --- a/board/boldar/sensors.c +++ b/board/boldar/sensors.c @@ -224,22 +224,3 @@ static void baseboard_sensors_init(void) gpio_enable_interrupt(GPIO_EC_IMU_INT_L); } DECLARE_HOOK(HOOK_INIT, baseboard_sensors_init, HOOK_PRIO_DEFAULT); - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/boten/board.c b/board/boten/board.c index dae2e74308..6bddbc86a7 100644 --- a/board/boten/board.c +++ b/board/boten/board.c @@ -475,9 +475,8 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -501,4 +500,3 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif diff --git a/board/collis/sensors.c b/board/collis/sensors.c index 92e034d50b..24284649a7 100644 --- a/board/collis/sensors.c +++ b/board/collis/sensors.c @@ -227,22 +227,3 @@ static void baseboard_sensors_init(void) gpio_enable_interrupt(GPIO_EC_IMU_INT_L); } DECLARE_HOOK(HOOK_INIT, baseboard_sensors_init, HOOK_PRIO_DEFAULT); - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/copano/sensors.c b/board/copano/sensors.c index 4d7ccdcebb..6a483a5671 100644 --- a/board/copano/sensors.c +++ b/board/copano/sensors.c @@ -227,22 +227,3 @@ static void baseboard_sensors_init(void) gpio_enable_interrupt(GPIO_EC_IMU_INT_L); } DECLARE_HOOK(HOOK_INIT, baseboard_sensors_init, HOOK_PRIO_DEFAULT); - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/coral/board.c b/board/coral/board.c index 2a63a60d13..869309f1fc 100644 --- a/board/coral/board.c +++ b/board/coral/board.c @@ -585,8 +585,7 @@ static void enable_input_devices(void) } /* 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. @@ -595,7 +594,6 @@ void lid_angle_peripheral_enable(int enable) enable = 0; keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif /* Called on AP S5 -> S3 transition */ static void board_chipset_startup(void) diff --git a/board/cret/board.c b/board/cret/board.c index 91870d65ec..55c79f8778 100644 --- a/board/cret/board.c +++ b/board/cret/board.c @@ -526,9 +526,8 @@ uint16_t tcpc_get_alert_status(void) return status; } -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -552,7 +551,6 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif /* Keyboard scan setting */ static const struct ec_response_keybd_config cret_keybd = { @@ -601,4 +599,4 @@ static void board_extpower(void) gpio_set_level(GPIO_EC_ACOK_OTG, extpower_present); } -DECLARE_HOOK(HOOK_AC_CHANGE, board_extpower, HOOK_PRIO_DEFAULT);
\ No newline at end of file +DECLARE_HOOK(HOOK_AC_CHANGE, board_extpower, HOOK_PRIO_DEFAULT); diff --git a/board/delbin/sensors.c b/board/delbin/sensors.c index a2b2eb47e4..fc8e30410b 100644 --- a/board/delbin/sensors.c +++ b/board/delbin/sensors.c @@ -158,22 +158,3 @@ static void baseboard_sensors_init(void) gpio_enable_interrupt(GPIO_EC_IMU_INT_L); } DECLARE_HOOK(HOOK_INIT, baseboard_sensors_init, HOOK_PRIO_DEFAULT); - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/dood/board.c b/board/dood/board.c index 35ecfecc9e..d92d28084d 100644 --- a/board/dood/board.c +++ b/board/dood/board.c @@ -283,9 +283,8 @@ void board_hibernate_late(void) gpio_set_flags(hibernate_pins[i][0], hibernate_pins[i][1]); } -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { /* * If the lid is in tablet position via other sensors, @@ -297,7 +296,6 @@ void lid_angle_peripheral_enable(int enable) if (board_is_convertible()) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif void board_overcurrent_event(int port, int is_overcurrented) { diff --git a/board/drawcia/board.c b/board/drawcia/board.c index 60ddffaaa5..80f93e4d1d 100644 --- a/board/drawcia/board.c +++ b/board/drawcia/board.c @@ -662,9 +662,8 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -688,7 +687,6 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif __override void ocpc_get_pid_constants(int *kp, int *kp_div, int *ki, int *ki_div, diff --git a/board/eldrid/sensors.c b/board/eldrid/sensors.c index 9a760897bf..aba3549cca 100644 --- a/board/eldrid/sensors.c +++ b/board/eldrid/sensors.c @@ -124,22 +124,3 @@ static void board_sensors_init(void) gpio_enable_interrupt(GPIO_EC_IMU_INT_L); } DECLARE_HOOK(HOOK_INIT, board_sensors_init, HOOK_PRIO_DEFAULT); - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/elm/board.c b/board/elm/board.c index 8918a1cbd4..a7415cda41 100644 --- a/board/elm/board.c +++ b/board/elm/board.c @@ -518,7 +518,7 @@ struct motion_sensor_t motion_sensors[] = { const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); diff --git a/board/eve/board.c b/board/eve/board.c index 81ea080e26..345dccb632 100644 --- a/board/eve/board.c +++ b/board/eve/board.c @@ -683,8 +683,7 @@ static void enable_input_devices(void) } /* 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 suspended and the lid is in 360 position, ignore the lid angle, @@ -700,7 +699,6 @@ void lid_angle_peripheral_enable(int enable) enable = 0; trackpad_wake_enable(enable); } -#endif /* Called on AP S5 -> S3 transition */ static void board_chipset_startup(void) diff --git a/board/fleex/board.c b/board/fleex/board.c index 82081fed48..ac04d3304b 100644 --- a/board/fleex/board.c +++ b/board/fleex/board.c @@ -278,9 +278,8 @@ static void cbi_init(void) } DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_INIT_I2C + 1); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { /* * If the lid is in tablet position via other sensors, @@ -292,7 +291,6 @@ void lid_angle_peripheral_enable(int enable) if (board_is_convertible()) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif void board_overcurrent_event(int port, int is_overcurrented) { @@ -333,4 +331,4 @@ int ppc_get_alert_status(int port) return gpio_get_level(GPIO_USB_PD_C0_INT_ODL) == 0; return gpio_get_level(GPIO_USB_PD_C1_INT_ODL) == 0; -}
\ No newline at end of file +} diff --git a/board/foob/board.c b/board/foob/board.c index 3d6e427220..3ff6fe65cb 100644 --- a/board/foob/board.c +++ b/board/foob/board.c @@ -222,9 +222,8 @@ static void cbi_init(void) } DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_INIT_I2C + 1); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { /* * If the lid is in tablet position via other sensors, @@ -237,7 +236,6 @@ void lid_angle_peripheral_enable(int enable) if (board_is_convertible()) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif int board_is_lid_angle_tablet_mode(void) { diff --git a/board/galtic/board.c b/board/galtic/board.c index 85195851fb..b15a04aa5a 100644 --- a/board/galtic/board.c +++ b/board/galtic/board.c @@ -736,9 +736,8 @@ struct ec_thermal_config thermal_params[] = { }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -762,7 +761,6 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif __override void board_pulse_entering_rw(void) { diff --git a/board/garg/board.c b/board/garg/board.c index ec74c69af7..2f20009f3a 100644 --- a/board/garg/board.c +++ b/board/garg/board.c @@ -345,9 +345,8 @@ void board_hibernate_late(void) gpio_set_flags(hibernate_pins[i][0], hibernate_pins[i][1]); } -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { /* * If the lid is in tablet position via other sensors, @@ -359,7 +358,6 @@ void lid_angle_peripheral_enable(int enable) if (board_is_convertible()) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif void board_overcurrent_event(int port, int is_overcurrented) { diff --git a/board/gimble/sensors.c b/board/gimble/sensors.c index 2931e68d31..500cd580d6 100644 --- a/board/gimble/sensors.c +++ b/board/gimble/sensors.c @@ -222,22 +222,3 @@ struct ec_thermal_config thermal_params[] = { [TEMP_SENSOR_3_CHARGER] = thermal_inductor, }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/gooey/board.c b/board/gooey/board.c index 9bef79f972..401ce167ad 100644 --- a/board/gooey/board.c +++ b/board/gooey/board.c @@ -460,9 +460,8 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -486,4 +485,3 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif diff --git a/board/guybrush/board.c b/board/guybrush/board.c index e85635d0a4..e6e7256eec 100644 --- a/board/guybrush/board.c +++ b/board/guybrush/board.c @@ -372,22 +372,3 @@ int board_get_soc_temp(int idx, int *temp_k) return tmp112_get_val(idx, temp_k); } - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/haboki/board.c b/board/haboki/board.c index d70c3788d2..f748cf90a6 100644 --- a/board/haboki/board.c +++ b/board/haboki/board.c @@ -647,9 +647,8 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -673,7 +672,6 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif __override void ocpc_get_pid_constants(int *kp, int *kp_div, int *ki, int *ki_div, diff --git a/board/herobrine_npcx7/board.c b/board/herobrine_npcx7/board.c index b5f55ea10c..a74b717399 100644 --- a/board/herobrine_npcx7/board.c +++ b/board/herobrine_npcx7/board.c @@ -269,23 +269,3 @@ struct motion_sensor_t motion_sensors[] = { }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); - -#ifndef TEST_BUILD -/* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/herobrine_npcx9/board.c b/board/herobrine_npcx9/board.c index 620880b607..f63f5c7991 100644 --- a/board/herobrine_npcx9/board.c +++ b/board/herobrine_npcx9/board.c @@ -271,23 +271,3 @@ struct motion_sensor_t motion_sensors[] = { }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); - -#ifndef TEST_BUILD -/* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/kracko/board.c b/board/kracko/board.c index a3d039327d..99dcd56810 100644 --- a/board/kracko/board.c +++ b/board/kracko/board.c @@ -705,9 +705,8 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -731,7 +730,6 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif __override void ocpc_get_pid_constants(int *kp, int *kp_div, int *ki, int *ki_div, diff --git a/board/lalala/board.c b/board/lalala/board.c index c7f6bb2b05..75562158ab 100644 --- a/board/lalala/board.c +++ b/board/lalala/board.c @@ -824,9 +824,8 @@ static void adc_vol_key_press_check(void) } DECLARE_HOOK(HOOK_TICK, adc_vol_key_press_check, HOOK_PRIO_DEFAULT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -850,4 +849,3 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif diff --git a/board/lantis/board.c b/board/lantis/board.c index 8bd879e610..a64d8fa17a 100644 --- a/board/lantis/board.c +++ b/board/lantis/board.c @@ -679,9 +679,8 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -705,7 +704,6 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif __override void ocpc_get_pid_constants(int *kp, int *kp_div, int *ki, int *ki_div, diff --git a/board/lazor/board.c b/board/lazor/board.c index d04f282c00..1e14dc420d 100644 --- a/board/lazor/board.c +++ b/board/lazor/board.c @@ -323,26 +323,6 @@ struct motion_sensor_t icm426xx_base_gyro = { .max_frequency = ICM426XX_GYRO_MAX_FREQ, }; -#ifndef TEST_BUILD -/* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) -{ - 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 - static int base_accelgyro_config; void motion_interrupt(enum gpio_signal signal) diff --git a/board/lick/board.c b/board/lick/board.c index 42c25e4613..69d11e881f 100644 --- a/board/lick/board.c +++ b/board/lick/board.c @@ -216,9 +216,8 @@ static void cbi_init(void) } DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_INIT_I2C + 1); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { /* * If the lid is in tablet position via other sensors, @@ -231,7 +230,6 @@ void lid_angle_peripheral_enable(int enable) if (board_is_convertible()) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif int board_is_lid_angle_tablet_mode(void) { diff --git a/board/lindar/board.c b/board/lindar/board.c index 621d0d305d..c9576f0e9b 100644 --- a/board/lindar/board.c +++ b/board/lindar/board.c @@ -109,8 +109,7 @@ int board_is_lid_angle_tablet_mode(void) } /* Enable or disable input devices, based on tablet mode or chipset state */ -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { if (ec_cfg_has_tabletmode()) { if (chipset_in_state(CHIPSET_STATE_ANY_OFF) || @@ -119,7 +118,6 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif /******************************************************************************/ /* Sensors */ diff --git a/board/lingcod/board.c b/board/lingcod/board.c index 88913a63af..feeed33119 100644 --- a/board/lingcod/board.c +++ b/board/lingcod/board.c @@ -96,8 +96,7 @@ int board_is_lid_angle_tablet_mode(void) } /* Enable or disable input devices, based on tablet mode or chipset state */ -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { if (ec_cfg_has_tabletmode()) { if (chipset_in_state(CHIPSET_STATE_ANY_OFF) || @@ -106,7 +105,6 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif /******************************************************************************/ /* Sensors */ diff --git a/board/madoo/board.c b/board/madoo/board.c index 1e1ee9b348..1c989b859e 100644 --- a/board/madoo/board.c +++ b/board/madoo/board.c @@ -598,9 +598,8 @@ uint16_t tcpc_get_alert_status(void) return status; } -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -624,4 +623,3 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif diff --git a/board/magolor/board.c b/board/magolor/board.c index c2f1129583..59464b4850 100644 --- a/board/magolor/board.c +++ b/board/magolor/board.c @@ -1073,9 +1073,8 @@ static void adc_vol_key_press_check(void) } DECLARE_HOOK(HOOK_TICK, adc_vol_key_press_check, HOOK_PRIO_DEFAULT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -1099,4 +1098,3 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif diff --git a/board/malefor/board.c b/board/malefor/board.c index 394aec8ee7..2dd92fabec 100644 --- a/board/malefor/board.c +++ b/board/malefor/board.c @@ -97,8 +97,7 @@ int board_is_lid_angle_tablet_mode(void) } /* Enable or disable input devices, based on tablet mode or chipset state */ -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { if (ec_cfg_has_tabletmode()) { if (chipset_in_state(CHIPSET_STATE_ANY_OFF) || @@ -107,7 +106,6 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif /******************************************************************************/ /* Sensors */ diff --git a/board/marzipan/board.c b/board/marzipan/board.c index 98716991cc..26b2c286c4 100644 --- a/board/marzipan/board.c +++ b/board/marzipan/board.c @@ -418,26 +418,6 @@ struct motion_sensor_t icm426xx_base_gyro = { .max_frequency = ICM426XX_GYRO_MAX_FREQ, }; -#ifndef TEST_BUILD -/* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) -{ - 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 - static int base_accelgyro_config; void motion_interrupt(enum gpio_signal signal) diff --git a/board/meep/board.c b/board/meep/board.c index 8d45c29dbd..7aba99d5b7 100644 --- a/board/meep/board.c +++ b/board/meep/board.c @@ -319,9 +319,8 @@ void board_hibernate_late(void) gpio_set_flags(hibernate_pins[i][0], hibernate_pins[i][1]); } -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { /* * If the lid is in tablet position via other sensors, @@ -334,7 +333,6 @@ void lid_angle_peripheral_enable(int enable) if (board_is_convertible()) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif #ifdef CONFIG_KEYBOARD_FACTORY_TEST /* diff --git a/board/metaknight/board.c b/board/metaknight/board.c index 2cddafd49e..f507259b7f 100644 --- a/board/metaknight/board.c +++ b/board/metaknight/board.c @@ -832,9 +832,8 @@ static void adc_vol_key_press_check(void) } DECLARE_HOOK(HOOK_TICK, adc_vol_key_press_check, HOOK_PRIO_DEFAULT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -859,6 +858,7 @@ void lid_angle_peripheral_enable(int enable) } } +#ifndef TEST_BUILD void motion_interrupt(enum gpio_signal signal) { switch (base_gyro_config) { 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) diff --git a/board/nautilus/board.c b/board/nautilus/board.c index ebdc360e16..bac1496a05 100644 --- a/board/nautilus/board.c +++ b/board/nautilus/board.c @@ -681,8 +681,7 @@ struct motion_sensor_t motion_sensors[] = { const 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. @@ -691,7 +690,6 @@ void lid_angle_peripheral_enable(int enable) enable = 0; keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif static void board_chipset_reset(void) { diff --git a/board/oak/board.c b/board/oak/board.c index f5b909b874..c478c6b293 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -726,7 +726,7 @@ struct motion_sensor_t motion_sensors[] = { }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } diff --git a/board/pazquel/board.c b/board/pazquel/board.c index edcc8e008b..bebf0e35e9 100644 --- a/board/pazquel/board.c +++ b/board/pazquel/board.c @@ -599,23 +599,3 @@ struct motion_sensor_t motion_sensors[] = { }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); - -#ifndef TEST_BUILD -/* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/phaser/board.c b/board/phaser/board.c index 636e14563e..0dc4354667 100644 --- a/board/phaser/board.c +++ b/board/phaser/board.c @@ -248,9 +248,8 @@ static void cbi_init(void) } DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_INIT_I2C + 1); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { /* * If the lid is in tablet position via other sensors, @@ -263,7 +262,6 @@ void lid_angle_peripheral_enable(int enable) if (board_is_convertible()) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif int board_is_lid_angle_tablet_mode(void) { diff --git a/board/pirika/board.c b/board/pirika/board.c index f780931107..a17d19bf88 100644 --- a/board/pirika/board.c +++ b/board/pirika/board.c @@ -724,9 +724,8 @@ struct ec_thermal_config thermal_params[] = { }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -750,7 +749,6 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif __override void board_pulse_entering_rw(void) { diff --git a/board/pompom/board.c b/board/pompom/board.c index ae9af4e596..8978b75981 100644 --- a/board/pompom/board.c +++ b/board/pompom/board.c @@ -641,23 +641,3 @@ static void board_update_sensor_config_from_sku(void) } DECLARE_HOOK(HOOK_INIT, board_update_sensor_config_from_sku, HOOK_PRIO_INIT_I2C + 2); - -#ifndef TEST_BUILD -/* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/rammus/board.c b/board/rammus/board.c index 93de4bd0bd..ff4ea53eba 100644 --- a/board/rammus/board.c +++ b/board/rammus/board.c @@ -677,8 +677,7 @@ struct motion_sensor_t motion_sensors[] = { const 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. @@ -687,7 +686,6 @@ void lid_angle_peripheral_enable(int enable) enable = 0; keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif static void board_chipset_reset(void) { diff --git a/board/reef/board.c b/board/reef/board.c index 26f5b8dceb..c37f84c507 100644 --- a/board/reef/board.c +++ b/board/reef/board.c @@ -572,8 +572,7 @@ static void enable_input_devices(void) } /* 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. @@ -582,7 +581,6 @@ void lid_angle_peripheral_enable(int enable) enable = 0; keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif /* Called on AP S5 -> S3 transition */ static void board_chipset_startup(void) diff --git a/board/reef_mchp/board.c b/board/reef_mchp/board.c index d5212ca931..334d4615db 100644 --- a/board/reef_mchp/board.c +++ b/board/reef_mchp/board.c @@ -782,8 +782,7 @@ static void enable_input_devices(void) } /* 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. @@ -792,7 +791,6 @@ void lid_angle_peripheral_enable(int enable) enable = 0; keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } -#endif /* Called on AP S5 -> S3 transition */ static void board_chipset_startup(void) diff --git a/board/storo/board.c b/board/storo/board.c index 33c32ee65a..6fd7e2bbf2 100644 --- a/board/storo/board.c +++ b/board/storo/board.c @@ -900,9 +900,8 @@ struct ec_thermal_config thermal_params[] = { }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -926,4 +925,3 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif diff --git a/board/terrador/sensors.c b/board/terrador/sensors.c index 9e34812131..9997591cb6 100644 --- a/board/terrador/sensors.c +++ b/board/terrador/sensors.c @@ -224,22 +224,3 @@ static void baseboard_sensors_init(void) gpio_enable_interrupt(GPIO_EC_IMU_INT_L); } DECLARE_HOOK(HOOK_INIT, baseboard_sensors_init, HOOK_PRIO_DEFAULT); - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/todor/sensors.c b/board/todor/sensors.c index 9e34812131..9997591cb6 100644 --- a/board/todor/sensors.c +++ b/board/todor/sensors.c @@ -224,22 +224,3 @@ static void baseboard_sensors_init(void) gpio_enable_interrupt(GPIO_EC_IMU_INT_L); } DECLARE_HOOK(HOOK_INIT, baseboard_sensors_init, HOOK_PRIO_DEFAULT); - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/trogdor/board.c b/board/trogdor/board.c index a9b72a560d..0261ada9ff 100644 --- a/board/trogdor/board.c +++ b/board/trogdor/board.c @@ -239,23 +239,3 @@ struct motion_sensor_t motion_sensors[] = { }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); - -#ifndef TEST_BUILD -/* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/voema/sensors.c b/board/voema/sensors.c index 08d1cb7841..b76bf77036 100644 --- a/board/voema/sensors.c +++ b/board/voema/sensors.c @@ -319,22 +319,3 @@ int board_accel_force_mode_mask(void) return (BIT(LID_ACCEL) | BIT(CLEAR_ALS)); } #endif - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/volet/sensors.c b/board/volet/sensors.c index 7185a9d65d..49e879ea94 100644 --- a/board/volet/sensors.c +++ b/board/volet/sensors.c @@ -245,22 +245,3 @@ void motion_interrupt(enum gpio_signal signal) break; } } - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/volteer/sensors.c b/board/volteer/sensors.c index 9ef4d80105..5f7e197924 100644 --- a/board/volteer/sensors.c +++ b/board/volteer/sensors.c @@ -223,22 +223,3 @@ static void baseboard_sensors_init(void) gpio_enable_interrupt(GPIO_EC_IMU_INT_L); } DECLARE_HOOK(HOOK_INIT, baseboard_sensors_init, HOOK_PRIO_DEFAULT); - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/voxel/sensors.c b/board/voxel/sensors.c index abb0ced9ac..9652463ae2 100644 --- a/board/voxel/sensors.c +++ b/board/voxel/sensors.c @@ -245,22 +245,3 @@ void motion_interrupt(enum gpio_signal signal) break; } } - -#ifndef TEST_BUILD -void lid_angle_peripheral_enable(int enable) -{ - 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 diff --git a/board/waddledee/board.c b/board/waddledee/board.c index 6541692195..1e4f8a387c 100644 --- a/board/waddledee/board.c +++ b/board/waddledee/board.c @@ -558,9 +558,8 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -584,4 +583,3 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif diff --git a/board/waddledoo/board.c b/board/waddledoo/board.c index a7e76e6525..f2eea52701 100644 --- a/board/waddledoo/board.c +++ b/board/waddledoo/board.c @@ -654,9 +654,8 @@ uint16_t tcpc_get_alert_status(void) return status; } -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -680,4 +679,3 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif diff --git a/board/waddledoo2/board.c b/board/waddledoo2/board.c index 6cd66a2b97..a157644ca5 100644 --- a/board/waddledoo2/board.c +++ b/board/waddledoo2/board.c @@ -824,9 +824,8 @@ static void adc_vol_key_press_check(void) } DECLARE_HOOK(HOOK_TICK, adc_vol_key_press_check, HOOK_PRIO_DEFAULT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -850,4 +849,3 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif diff --git a/board/wheelie/board.c b/board/wheelie/board.c index 71ceab13b5..198dbda284 100644 --- a/board/wheelie/board.c +++ b/board/wheelie/board.c @@ -460,9 +460,8 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); -#ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) +__override void lid_angle_peripheral_enable(int enable) { int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON); @@ -486,4 +485,3 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE); } } -#endif diff --git a/board/yorp/board.c b/board/yorp/board.c index b6431c9da7..4a618133f3 100644 --- a/board/yorp/board.c +++ b/board/yorp/board.c @@ -211,25 +211,6 @@ void board_hibernate_late(void) { } #ifndef TEST_BUILD -/* This callback disables keyboard when convertibles are fully open */ -void lid_angle_peripheral_enable(int enable) -{ - 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); - } -} - - static void post_old_board_warning(void) { uint32_t board_id = 0; |