Skip to content

Commit 1ba0763

Browse files
authored
Merge pull request #698 from FrameworkComputer/lotus.input_module_mode_control
Input module mode control immediately
2 parents 3ffa896 + 0bc7a18 commit 1ba0763

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

zephyr/program/lotus/lotus/src/input_module.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,16 @@ static enum ec_status check_deck_state(struct host_cmd_handler_args *args)
178178
int idx;
179179

180180
/* set mode */
181-
if (p->mode == 0x01)
181+
if (p->mode == 0x01) {
182182
deck_state = DECK_DISCONNECTED;
183-
else if (p->mode == 0x02)
183+
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_hub_b_pwr_en), 0);
184+
} else if (p->mode == 0x02) {
184185
deck_state = DECK_FORCE_ON;
185-
else if (p->mode == 0x04)
186+
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_hub_b_pwr_en), 1);
187+
} else if (p->mode == 0x04) {
186188
deck_state = DECK_FORCE_OFF;
189+
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_hub_b_pwr_en), 0);
190+
}
187191

188192
set_detect_mode(p->mode);
189193

0 commit comments

Comments
 (0)