From 412093d046ec6eab64798f70bff98c8865f709d3 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Mon, 17 Jul 2017 16:57:58 +0800 Subject: stm32: gpio: implement gpio_disable_interrupt gpio_disable_interrupt is missing for stm32, add it so board functions can use it. BRANCH=none BUG=b:63685022 TEST=`make BOARD=rose -j` Change-Id: Ibbdd8506540e7949fa110c26131dca028671be06 Signed-off-by: Wei-Ning Huang Reviewed-on: https://chromium-review.googlesource.com/573981 Commit-Ready: Wei-Ning Huang Tested-by: Wei-Ning Huang Reviewed-by: Rong Chang --- chip/stm32/gpio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/chip/stm32/gpio.c b/chip/stm32/gpio.c index 69f3cadb4e..a89f046a01 100644 --- a/chip/stm32/gpio.c +++ b/chip/stm32/gpio.c @@ -98,6 +98,19 @@ int gpio_enable_interrupt(enum gpio_signal signal) return EC_SUCCESS; } +int gpio_disable_interrupt(enum gpio_signal signal) +{ + const struct gpio_info *g = gpio_list + signal; + + /* Fail if not implemented or no interrupt handler */ + if (!g->mask || signal >= GPIO_IH_COUNT) + return EC_ERROR_INVAL; + + STM32_EXTI_IMR &= ~g->mask; + + return EC_SUCCESS; +} + int gpio_clear_pending_interrupt(enum gpio_signal signal) { const struct gpio_info *g = gpio_list + signal; -- cgit v1.2.1