File tree 1 file changed +19
-0
lines changed
zephyr/program/lotus/lotus/src
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 7
7
#include <zephyr/init.h>
8
8
#include "gpio/gpio_int.h"
9
9
#include "board_host_command.h"
10
+ #include "chipset.h"
10
11
#include "console.h"
11
12
#include "extpower.h"
12
13
#include "gpio.h"
20
21
21
22
#include "board_adc.h"
22
23
#include "flash_storage.h"
24
+ #include "lid_switch.h"
23
25
24
26
LOG_MODULE_REGISTER (inputmodule , LOG_LEVEL_INF );
25
27
@@ -128,6 +130,23 @@ bool input_deck_is_fully_populated(void)
128
130
return true;
129
131
}
130
132
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
+
131
150
static void poll_c_deck (void )
132
151
{
133
152
static int turning_on_count ;
You can’t perform that action at this time.
0 commit comments