Skip to content

Commit

Permalink
driver: gpio: npcx: Implement enable/disable pin interrupt
Browse files Browse the repository at this point in the history
Implement the GPIO_INT_MODE_ENABLE_ONLY and GPIO_INT_MODE_DISABLE_ONLY
on npcx GPIO driver.

Signed-off-by: Sung-Chi Li <[email protected]>
  • Loading branch information
LSChyi authored and cfriedt committed Apr 6, 2023
1 parent ab77ce0 commit db379ee
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/gpio/gpio_npcx.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,15 @@ static int gpio_npcx_pin_interrupt_configure(const struct device *dev,
config->port, pin, config->wui_maps[pin].table,
config->wui_maps[pin].group,
config->wui_maps[pin].bit);
#ifdef CONFIG_GPIO_ENABLE_DISABLE_INTERRUPT
if (mode == GPIO_INT_MODE_DISABLE_ONLY) {
npcx_miwu_irq_disable(&config->wui_maps[pin]);
return 0;
} else if (mode == GPIO_INT_MODE_ENABLE_ONLY) {
npcx_miwu_irq_enable(&config->wui_maps[pin]);
return 0;
}
#endif /* CONFIG_GPIO_ENABLE_DISABLE_INTERRUPT */

/* Disable irq of wake-up input io-pads before configuring them */
npcx_miwu_irq_disable(&config->wui_maps[pin]);
Expand Down

0 comments on commit db379ee

Please sign in to comment.