summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2021-08-03 17:17:56 -0700
committerCommit Bot <commit-bot@chromium.org>2021-08-05 00:13:33 +0000
commit2eb53a39662b905c65015bafb5f73ab2324d369c (patch)
tree6352433557cdb05c75b1eef449c9ecf844bfc3d0
parentfc016f2dce16d0555deee69e00ea5a626eb27f21 (diff)
downloadchrome-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>
-rw-r--r--baseboard/asurada/baseboard.c21
-rw-r--r--baseboard/cherry/baseboard.c21
-rw-r--r--baseboard/goroh/baseboard.c21
-rw-r--r--baseboard/grunt/baseboard.c4
-rw-r--r--baseboard/hatch/baseboard.c4
-rw-r--r--baseboard/kukui/baseboard.c4
-rw-r--r--baseboard/zork/baseboard.c4
-rw-r--r--board/ampton/board.c4
-rw-r--r--board/bloog/board.c4
-rw-r--r--board/bobba/board.c4
-rw-r--r--board/boldar/sensors.c19
-rw-r--r--board/boten/board.c4
-rw-r--r--board/collis/sensors.c19
-rw-r--r--board/copano/sensors.c19
-rw-r--r--board/coral/board.c4
-rw-r--r--board/cret/board.c6
-rw-r--r--board/delbin/sensors.c19
-rw-r--r--board/dood/board.c4
-rw-r--r--board/drawcia/board.c4
-rw-r--r--board/eldrid/sensors.c19
-rw-r--r--board/elm/board.c2
-rw-r--r--board/eve/board.c4
-rw-r--r--board/fleex/board.c6
-rw-r--r--board/foob/board.c4
-rw-r--r--board/galtic/board.c4
-rw-r--r--board/garg/board.c4
-rw-r--r--board/gimble/sensors.c19
-rw-r--r--board/gooey/board.c4
-rw-r--r--board/guybrush/board.c19
-rw-r--r--board/haboki/board.c4
-rw-r--r--board/herobrine_npcx7/board.c20
-rw-r--r--board/herobrine_npcx9/board.c20
-rw-r--r--board/kracko/board.c4
-rw-r--r--board/lalala/board.c4
-rw-r--r--board/lantis/board.c4
-rw-r--r--board/lazor/board.c20
-rw-r--r--board/lick/board.c4
-rw-r--r--board/lindar/board.c4
-rw-r--r--board/lingcod/board.c4
-rw-r--r--board/madoo/board.c4
-rw-r--r--board/magolor/board.c4
-rw-r--r--board/malefor/board.c4
-rw-r--r--board/marzipan/board.c20
-rw-r--r--board/meep/board.c4
-rw-r--r--board/metaknight/board.c4
-rw-r--r--board/nami/board.c4
-rw-r--r--board/nautilus/board.c4
-rw-r--r--board/oak/board.c2
-rw-r--r--board/pazquel/board.c20
-rw-r--r--board/phaser/board.c4
-rw-r--r--board/pirika/board.c4
-rw-r--r--board/pompom/board.c20
-rw-r--r--board/rammus/board.c4
-rw-r--r--board/reef/board.c4
-rw-r--r--board/reef_mchp/board.c4
-rw-r--r--board/storo/board.c4
-rw-r--r--board/terrador/sensors.c19
-rw-r--r--board/todor/sensors.c19
-rw-r--r--board/trogdor/board.c20
-rw-r--r--board/voema/sensors.c19
-rw-r--r--board/volet/sensors.c19
-rw-r--r--board/volteer/sensors.c19
-rw-r--r--board/voxel/sensors.c19
-rw-r--r--board/waddledee/board.c4
-rw-r--r--board/waddledoo/board.c4
-rw-r--r--board/waddledoo2/board.c4
-rw-r--r--board/wheelie/board.c4
-rw-r--r--board/yorp/board.c19
-rw-r--r--common/lid_angle.c22
-rw-r--r--include/lid_angle.h2
-rw-r--r--zephyr/projects/asurada/hayato/CMakeLists.txt4
-rw-r--r--zephyr/projects/asurada/hayato/src/sensors.c29
-rw-r--r--zephyr/projects/herobrine/herobrine_npcx9/CMakeLists.txt2
-rw-r--r--zephyr/projects/herobrine/herobrine_npcx9/src/sensors.c29
-rw-r--r--zephyr/projects/trogdor/herobrine_npcx7/CMakeLists.txt2
-rw-r--r--zephyr/projects/trogdor/herobrine_npcx7/src/sensors.c29
-rw-r--r--zephyr/projects/trogdor/lazor/CMakeLists.txt2
-rw-r--r--zephyr/projects/trogdor/lazor/src/sensors.c29
-rw-r--r--zephyr/projects/trogdor/trogdor/CMakeLists.txt2
-rw-r--r--zephyr/projects/trogdor/trogdor/src/sensors.c29
-rw-r--r--zephyr/projects/volteer/delbin/CMakeLists.txt4
-rw-r--r--zephyr/projects/volteer/delbin/src/sensors.c28
-rw-r--r--zephyr/projects/volteer/volteer/CMakeLists.txt4
-rw-r--r--zephyr/projects/volteer/volteer/src/sensors.c29
84 files changed, 68 insertions, 823 deletions
diff --git a/baseboard/asurada/baseboard.c b/baseboard/asurada/baseboard.c
index 8780297939..c00a990483 100644
--- a/baseboard/asurada/baseboard.c
+++ b/baseboard/asurada/baseboard.c
@@ -123,24 +123,3 @@ const struct cc_para_t *board_get_cc_tuning_parameter(enum usbpd_port port)
return &cc_parameter[port];
}
-
-/* Lid */
-#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/baseboard/cherry/baseboard.c b/baseboard/cherry/baseboard.c
index 507febf712..e3201a96af 100644
--- a/baseboard/cherry/baseboard.c
+++ b/baseboard/cherry/baseboard.c
@@ -592,27 +592,6 @@ int board_regulator_get_voltage(uint32_t index, uint32_t *voltage_mv)
return mt6360_regulator_get_voltage(id, voltage_mv);
}
-/* Lid */
-#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 void baseboard_init(void)
{
gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_ODL);
diff --git a/baseboard/goroh/baseboard.c b/baseboard/goroh/baseboard.c
index b14521f76d..c738033018 100644
--- a/baseboard/goroh/baseboard.c
+++ b/baseboard/goroh/baseboard.c
@@ -566,27 +566,6 @@ int board_regulator_get_voltage(uint32_t index, uint32_t *voltage_mv)
return mt6360_regulator_get_voltage(id, voltage_mv);
}
-/* Lid */
-#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 void baseboard_init(void)
{
gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_ODL);
diff --git a/baseboard/grunt/baseboard.c b/baseboard/grunt/baseboard.c
index 9d06fd4b78..70270f6927 100644
--- a/baseboard/grunt/baseboard.c
+++ b/baseboard/grunt/baseboard.c
@@ -645,13 +645,11 @@ unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
#endif /* HAS_TASK_MOTIONSENSE */
-#ifndef TEST_BUILD
-void lid_angle_peripheral_enable(int enable)
+__override void lid_angle_peripheral_enable(int enable)
{
if (board_is_convertible())
keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE);
}
-#endif
static const int sku_thresh_mv[] = {
/* Vin = 3.3V, Ideal voltage, R2 values listed below */
diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c
index 834406dd93..dd93e581cf 100644
--- a/baseboard/hatch/baseboard.c
+++ b/baseboard/hatch/baseboard.c
@@ -336,8 +336,7 @@ void baseboard_mst_enable_control(enum mst_source src, int level)
#endif
/* Enable or disable input devices, based on chipset state */
-#ifndef TEST_BUILD
-void lid_angle_peripheral_enable(int enable)
+__override void lid_angle_peripheral_enable(int enable)
{
if (board_is_convertible()) {
if (chipset_in_state(CHIPSET_STATE_ANY_OFF))
@@ -345,7 +344,6 @@ void lid_angle_peripheral_enable(int enable)
keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE);
}
}
-#endif
static uint8_t sku_id;
static uint8_t board_id;
diff --git a/baseboard/kukui/baseboard.c b/baseboard/kukui/baseboard.c
index 03023b1068..a779d57791 100644
--- a/baseboard/kukui/baseboard.c
+++ b/baseboard/kukui/baseboard.c
@@ -201,8 +201,8 @@ int board_allow_i2c_passthru(int port)
}
/* Enable or disable input devices, based on chipset state and tablet mode */
-#if !defined(TEST_BUILD) && defined(VARIANT_KUKUI_JACUZZI)
-void lid_angle_peripheral_enable(int enable)
+#ifdef VARIANT_KUKUI_JACUZZI
+__override void lid_angle_peripheral_enable(int enable)
{
int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON);
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c
index 41c859ad7b..00ccaf23c4 100644
--- a/baseboard/zork/baseboard.c
+++ b/baseboard/zork/baseboard.c
@@ -156,8 +156,7 @@ const struct thermistor_info thermistor_info = {
.data = thermistor_data,
};
-#ifndef TEST_BUILD
-void lid_angle_peripheral_enable(int enable)
+__override void lid_angle_peripheral_enable(int enable)
{
if (ec_config_has_lid_angle_tablet_mode()) {
int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON);
@@ -177,7 +176,6 @@ void lid_angle_peripheral_enable(int enable)
}
}
}
-#endif
static void cbi_init(void)
{
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;
diff --git a/common/lid_angle.c b/common/lid_angle.c
index 295f5486ac..8a3775b959 100644
--- a/common/lid_angle.c
+++ b/common/lid_angle.c
@@ -178,9 +178,25 @@ static void suspend_peripherals(void)
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, suspend_peripherals, HOOK_PRIO_DEFAULT);
#endif /* CONFIG_TABLET_MODE */
-/* Board level callback was not linked in test build, implement it here. */
#ifdef TEST_BUILD
-void lid_angle_peripheral_enable(int enable)
+__overridable void lid_angle_peripheral_enable(int enable)
{
}
-#endif
+#else
+__overridable 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 /* TEST_BUILD */
diff --git a/include/lid_angle.h b/include/lid_angle.h
index 22eec683f7..24275db313 100644
--- a/include/lid_angle.h
+++ b/include/lid_angle.h
@@ -30,6 +30,6 @@ void lid_angle_set_wake_angle(int ang);
*
* @param enable Flag that enables or disables peripherals.
*/
-void lid_angle_peripheral_enable(int enable);
+__override_proto void lid_angle_peripheral_enable(int enable);
#endif /* __CROS_EC_LID_ANGLE_H */
diff --git a/zephyr/projects/asurada/hayato/CMakeLists.txt b/zephyr/projects/asurada/hayato/CMakeLists.txt
index c4703e4024..f6d4eba58f 100644
--- a/zephyr/projects/asurada/hayato/CMakeLists.txt
+++ b/zephyr/projects/asurada/hayato/CMakeLists.txt
@@ -27,7 +27,3 @@ zephyr_library_sources(
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_I2C
"src/i2c.c")
-
-# Board specific sensor implementation
-zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MOTIONSENSE
- "src/sensors.c")
diff --git a/zephyr/projects/asurada/hayato/src/sensors.c b/zephyr/projects/asurada/hayato/src/sensors.c
deleted file mode 100644
index 6207461976..0000000000
--- a/zephyr/projects/asurada/hayato/src/sensors.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "chipset.h"
-#include "common.h"
-#include "keyboard_scan.h"
-
-/* Hayato board specific sensor implementation */
-
-#ifdef CONFIG_LID_ANGLE_UPDATE
-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/zephyr/projects/herobrine/herobrine_npcx9/CMakeLists.txt b/zephyr/projects/herobrine/herobrine_npcx9/CMakeLists.txt
index 9dcd46db31..23b3a2c245 100644
--- a/zephyr/projects/herobrine/herobrine_npcx9/CMakeLists.txt
+++ b/zephyr/projects/herobrine/herobrine_npcx9/CMakeLists.txt
@@ -15,8 +15,6 @@ zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USBC
"src/usb_pd_policy.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_LED_COMMON
"src/led.c")
-zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MOTIONSENSE
- "src/sensors.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_I2C
"src/i2c.c")
diff --git a/zephyr/projects/herobrine/herobrine_npcx9/src/sensors.c b/zephyr/projects/herobrine/herobrine_npcx9/src/sensors.c
deleted file mode 100644
index dd9ce10a16..0000000000
--- a/zephyr/projects/herobrine/herobrine_npcx9/src/sensors.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "chipset.h"
-#include "common.h"
-#include "keyboard_scan.h"
-
-/* Herobrine-NPCX9 board specific sensor implementation */
-
-#ifdef CONFIG_LID_ANGLE_UPDATE
-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/zephyr/projects/trogdor/herobrine_npcx7/CMakeLists.txt b/zephyr/projects/trogdor/herobrine_npcx7/CMakeLists.txt
index 61f8c8ef7b..245e2b6689 100644
--- a/zephyr/projects/trogdor/herobrine_npcx7/CMakeLists.txt
+++ b/zephyr/projects/trogdor/herobrine_npcx7/CMakeLists.txt
@@ -29,7 +29,5 @@ zephyr_library_sources(
"${PLATFORM_EC_BOARD}/usbc_config.c")
# Board specific implementation
-zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MOTIONSENSE
- "src/sensors.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_I2C
"src/i2c.c")
diff --git a/zephyr/projects/trogdor/herobrine_npcx7/src/sensors.c b/zephyr/projects/trogdor/herobrine_npcx7/src/sensors.c
deleted file mode 100644
index 87eb6757d6..0000000000
--- a/zephyr/projects/trogdor/herobrine_npcx7/src/sensors.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "chipset.h"
-#include "common.h"
-#include "keyboard_scan.h"
-
-/* Herobrine-NPCX7 board specific sensor implementation */
-
-#ifdef CONFIG_LID_ANGLE_UPDATE
-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/zephyr/projects/trogdor/lazor/CMakeLists.txt b/zephyr/projects/trogdor/lazor/CMakeLists.txt
index 40a6b47d67..3c8372cebf 100644
--- a/zephyr/projects/trogdor/lazor/CMakeLists.txt
+++ b/zephyr/projects/trogdor/lazor/CMakeLists.txt
@@ -31,7 +31,5 @@ zephyr_library_sources(
"${PLATFORM_EC_BOARD}/usbc_config.c")
# Board specific implementation
-zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MOTIONSENSE
- "src/sensors.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_I2C
"src/i2c.c")
diff --git a/zephyr/projects/trogdor/lazor/src/sensors.c b/zephyr/projects/trogdor/lazor/src/sensors.c
deleted file mode 100644
index becf1f8829..0000000000
--- a/zephyr/projects/trogdor/lazor/src/sensors.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "chipset.h"
-#include "common.h"
-#include "keyboard_scan.h"
-
-/* Lazor board specific sensor implementation */
-
-#ifdef CONFIG_LID_ANGLE_UPDATE
-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/zephyr/projects/trogdor/trogdor/CMakeLists.txt b/zephyr/projects/trogdor/trogdor/CMakeLists.txt
index 3edae376a2..d470dd8409 100644
--- a/zephyr/projects/trogdor/trogdor/CMakeLists.txt
+++ b/zephyr/projects/trogdor/trogdor/CMakeLists.txt
@@ -29,7 +29,5 @@ zephyr_library_sources(
"${PLATFORM_EC_BOARD}/usbc_config.c")
# Board specific implementation
-zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MOTIONSENSE
- "src/sensors.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_I2C
"src/i2c.c")
diff --git a/zephyr/projects/trogdor/trogdor/src/sensors.c b/zephyr/projects/trogdor/trogdor/src/sensors.c
deleted file mode 100644
index 6d32e250cd..0000000000
--- a/zephyr/projects/trogdor/trogdor/src/sensors.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "chipset.h"
-#include "common.h"
-#include "keyboard_scan.h"
-
-/* Trogdor board specific sensor implementation */
-
-#ifdef CONFIG_LID_ANGLE_UPDATE
-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/zephyr/projects/volteer/delbin/CMakeLists.txt b/zephyr/projects/volteer/delbin/CMakeLists.txt
index 441c730634..0303ee7c62 100644
--- a/zephyr/projects/volteer/delbin/CMakeLists.txt
+++ b/zephyr/projects/volteer/delbin/CMakeLists.txt
@@ -21,7 +21,3 @@ zephyr_library_include_directories(
# Include selected EC source for the baseboard
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ
"${PLATFORM_EC_BASEBOARD}/power.c")
-
-# Board specific sensor implementation
-zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MOTIONSENSE
- "src/sensors.c")
diff --git a/zephyr/projects/volteer/delbin/src/sensors.c b/zephyr/projects/volteer/delbin/src/sensors.c
deleted file mode 100644
index 8a052837f8..0000000000
--- a/zephyr/projects/volteer/delbin/src/sensors.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "chipset.h"
-#include "common.h"
-#include "keyboard_scan.h"
-#include "lid_angle.h"
-
-/* Delbin board specific sensor implementation */
-
-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);
- }
-}
diff --git a/zephyr/projects/volteer/volteer/CMakeLists.txt b/zephyr/projects/volteer/volteer/CMakeLists.txt
index c749cfc340..8c01874b1b 100644
--- a/zephyr/projects/volteer/volteer/CMakeLists.txt
+++ b/zephyr/projects/volteer/volteer/CMakeLists.txt
@@ -43,7 +43,3 @@ zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_LED_COMMON
"${PLATFORM_EC_BOARD}/led.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USBC
"${PLATFORM_EC_BOARD}/usbc_config.c")
-
-# Board specific sensor implementation
-zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MOTIONSENSE
- "src/sensors.c")
diff --git a/zephyr/projects/volteer/volteer/src/sensors.c b/zephyr/projects/volteer/volteer/src/sensors.c
deleted file mode 100644
index eb4e547c54..0000000000
--- a/zephyr/projects/volteer/volteer/src/sensors.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "chipset.h"
-#include "common.h"
-#include "keyboard_scan.h"
-
-/* Volteer board specific sensor implementation */
-
-#ifdef CONFIG_LID_ANGLE_UPDATE
-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