diff options
author | Yilun Lin <yllin@chromium.org> | 2019-11-01 14:06:34 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-02 05:01:40 +0000 |
commit | 9146a5e4a9eb1e1402ef61b23795b4ead4f17510 (patch) | |
tree | e7986675575024c3db723718dfec6e7de096829d | |
parent | 6beb3ea38ae9ce61ab4c3b92044d57d3101ff26e (diff) | |
download | chrome-ec-9146a5e4a9eb1e1402ef61b23795b4ead4f17510.tar.gz |
mt_scp/gpio: set GPIO_ALT_FUNC_NONE to GPIO_ALT_FUNC_DEFAULT
The common EC code expects that if the func parameter passed to
gpio_set_alternate_function() is -1 (GPIO_ALT_FUNC_NONE),
that the pin will be reassigned to a GPIO function.
TEST=make buildall
BUG=b:143710991
BRANCH=kukui
Change-Id: I6ba3d3d323e4fb99617ce4baaec662ceab094ad4
Signed-off-by: Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1893026
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | chip/mt_scp/gpio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chip/mt_scp/gpio.c b/chip/mt_scp/gpio.c index 736a961951..a4896aae72 100644 --- a/chip/mt_scp/gpio.c +++ b/chip/mt_scp/gpio.c @@ -22,6 +22,9 @@ void gpio_set_alternate_function(uint32_t port, uint32_t mask, if (func > GPIO_ALT_FUNC_7) return; + if (func == GPIO_ALT_FUNC_NONE) + func = GPIO_ALT_FUNC_DEFAULT; + while (mask) { /* 32 gpio per port */ bit = get_next_bit(&mask); @@ -175,4 +178,3 @@ void __keep gpio_interrupt(void) } } DECLARE_IRQ(SCP_IRQ_EINT, gpio_interrupt, 1); - |