diff options
-rw-r--r-- | board/kevin/board.c | 21 | ||||
-rw-r--r-- | chip/npcx/gpio.c | 11 |
2 files changed, 14 insertions, 18 deletions
diff --git a/board/kevin/board.c b/board/kevin/board.c index 34f2c3ee3a..a152ea94b5 100644 --- a/board/kevin/board.c +++ b/board/kevin/board.c @@ -258,9 +258,17 @@ int pd_snk_is_vbus_provided(int port) static void board_init(void) { + /* Enable TCPC alert interrupts */ + gpio_enable_interrupt(GPIO_USB_C0_PD_INT_L); + gpio_enable_interrupt(GPIO_USB_C1_PD_INT_L); + /* Enable charger interrupt for BC1.2 detection on attach / detach */ gpio_enable_interrupt(GPIO_CHARGER_INT_L); + /* Enable reboot / shutdown control inputs from AP */ + gpio_enable_interrupt(GPIO_WARM_RESET_REQ); + gpio_enable_interrupt(GPIO_AP_OVERTEMP); + /* Sensor Init */ gpio_config_module(MODULE_SPI_MASTER, 1); spi_enable(CONFIG_SPI_ACCEL_PORT, 1); @@ -390,19 +398,6 @@ static void board_config_check(void) DECLARE_HOOK(HOOK_INIT, board_config_check, HOOK_PRIO_LAST); #endif /* ifndef CONFIG_USB_PD_5V_EN_ACTIVE_LOW */ -static void overtemp_interrupt_enable(void) -{ - gpio_enable_interrupt(GPIO_AP_OVERTEMP); -} -DECLARE_HOOK(HOOK_CHIPSET_RESUME, overtemp_interrupt_enable, - HOOK_PRIO_DEFAULT); -static void overtemp_interrupt_disable(void) -{ - gpio_disable_interrupt(GPIO_AP_OVERTEMP); -} -DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, overtemp_interrupt_disable, - HOOK_PRIO_DEFAULT); - /* Motion sensors */ #ifdef HAS_TASK_MOTIONSENSE /* Mutexes */ diff --git a/chip/npcx/gpio.c b/chip/npcx/gpio.c index 1d701203c7..4e3b19e31c 100644 --- a/chip/npcx/gpio.c +++ b/chip/npcx/gpio.c @@ -472,7 +472,6 @@ static void gpio_interrupt_type_sel(uint8_t port, uint8_t mask, uint32_t flags) NPCX_WKEDG(table, group) |= pmask; /* Enable wake-up input sources */ - NPCX_WKEN(table, group) |= pmask; NPCX_WKINEN(table, group) |= pmask; /* * Clear pending bit since it might be set @@ -505,7 +504,6 @@ static void gpio_interrupt_type_sel(uint8_t port, uint8_t mask, uint32_t flags) } /* Enable wake-up input sources */ - NPCX_WKEN(table, group) |= pmask; NPCX_WKINEN(table, group) |= pmask; /* * Clear pending bit since it might be set @@ -682,10 +680,13 @@ void gpio_pre_init(void) SET_BIT(NPCX_DEVALT(ALT_GROUP_1), NPCX_DEVALT1_NO_LPC_ESPI); #endif - /* Clear all pending bits of GPIOS*/ - for (i = 0; i < 2; i++) - for (j = 0; j < 8; j++) + /* Clear all interrupt pending and enable bits of GPIOS */ + for (i = 0; i < 2; i++) { + for (j = 0; j < 8; j++) { NPCX_WKPCL(i, j) = 0xFF; + NPCX_WKEN(i, j) = 0; + } + } /* No support enable clock for the GPIO port in run and sleep. */ /* Set flag for each GPIO pin in gpio_list */ |