diff --git a/board/oak/board.c b/board/oak/board.c index d2ac75d20b..6c1f9ff571 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -27,6 +27,7 @@ #include "host_command.h" #include "i2c.h" #include "keyboard_raw.h" +#include "keyboard_scan.h" #include "lid_switch.h" #include "math_util.h" #include "motion_lid.h" @@ -748,4 +749,9 @@ struct motion_sensor_t motion_sensors[] = { }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); + +void lid_angle_peripheral_enable(int enable) +{ + keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); +} #endif /* defined(HAS_TASK_MOTIONSENSE) */ diff --git a/board/oak/board.h b/board/oak/board.h index 46072eb001..b657b1b257 100644 --- a/board/oak/board.h +++ b/board/oak/board.h @@ -79,6 +79,7 @@ #define CONFIG_LID_ANGLE #define CONFIG_LID_ANGLE_SENSOR_BASE 0 #define CONFIG_LID_ANGLE_SENSOR_LID 2 +#define CONFIG_LID_ANGLE_UPDATE #define CONFIG_LID_SWITCH #define CONFIG_LOW_POWER_IDLE #define CONFIG_MKBP_EVENT diff --git a/common/lid_angle.c b/common/lid_angle.c index f6091f4349..24b2e8ca60 100644 --- a/common/lid_angle.c +++ b/common/lid_angle.c @@ -164,3 +164,10 @@ static void enable_peripherals(void) lid_angle_peripheral_enable(1); } DECLARE_HOOK(HOOK_CHIPSET_RESUME, enable_peripherals, HOOK_PRIO_DEFAULT); + +/* Board level callback was not linked in test build, implement it here. */ +#ifdef TEST_BUILD +void lid_angle_peripheral_enable(int enable) +{ +} +#endif