summaryrefslogtreecommitdiff
path: root/chip/lm4/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/lm4/gpio.c')
-rw-r--r--chip/lm4/gpio.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c
index b3dff342e8..65d6548f90 100644
--- a/chip/lm4/gpio.c
+++ b/chip/lm4/gpio.c
@@ -42,7 +42,8 @@ static int find_gpio_port_index(uint32_t port_base)
return -1;
}
-void gpio_set_alternate_function(uint32_t port, uint32_t mask, int func)
+void gpio_set_alternate_function(uint32_t port, uint32_t mask,
+ enum gpio_alternate_func func)
{
int port_index = find_gpio_port_index(port);
int cgmask;
@@ -56,7 +57,7 @@ void gpio_set_alternate_function(uint32_t port, uint32_t mask, int func)
clock_enable_peripheral(CGC_OFFSET_GPIO, cgmask,
CGC_MODE_RUN | CGC_MODE_SLEEP);
- if (func >= 0) {
+ if (func != GPIO_ALT_FUNC_NONE) {
int pctlmask = 0;
int i;
/* Expand mask from bits to nibbles */
@@ -261,7 +262,8 @@ void gpio_pre_init(void)
gpio_set_flags_by_mask(g->port, g->mask, flags);
/* Use as GPIO, not alternate function */
- gpio_set_alternate_function(g->port, g->mask, -1);
+ gpio_set_alternate_function(g->port, g->mask,
+ GPIO_ALT_FUNC_NONE);
}
#ifdef CONFIG_LOW_POWER_IDLE