File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
zephyr/program/lotus/lotus/src Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 77#include <zephyr/init.h>
88#include "gpio/gpio_int.h"
99#include "board_host_command.h"
10+ #include "chipset.h"
1011#include "console.h"
1112#include "extpower.h"
1213#include "gpio.h"
2021
2122#include "board_adc.h"
2223#include "flash_storage.h"
24+ #include "lid_switch.h"
2325
2426LOG_MODULE_REGISTER (inputmodule , LOG_LEVEL_INF );
2527
@@ -128,6 +130,23 @@ bool input_deck_is_fully_populated(void)
128130 return true;
129131}
130132
133+ /* Make sure the inputdeck is sleeping when lid is closed */
134+ static void inputdeck_lid_change (void )
135+ {
136+ /* If suspend or off we don't want to turn on input module LEDs even if the lid is open */
137+ if (!chipset_in_state (CHIPSET_STATE_ON ))
138+ return ;
139+
140+ if (lid_is_open ()) {
141+ gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_sleep_l ), 1 );
142+ } else {
143+ gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_sleep_l ), 0 );
144+ }
145+
146+ }
147+ DECLARE_HOOK (HOOK_LID_CHANGE , inputdeck_lid_change , HOOK_PRIO_DEFAULT );
148+
149+
131150static void poll_c_deck (void )
132151{
133152 static int turning_on_count ;
You can’t perform that action at this time.
0 commit comments