diff options
-rw-r--r-- | chip/lm4/gpio.c | 2 | ||||
-rw-r--r-- | chip/stm32/gpio-stm32f100.c | 2 | ||||
-rw-r--r-- | chip/stm32/gpio-stm32l15x.c | 2 | ||||
-rw-r--r-- | include/gpio.h | 2 |
4 files changed, 7 insertions, 1 deletions
diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c index 665b261483..f5eca38a79 100644 --- a/chip/lm4/gpio.c +++ b/chip/lm4/gpio.c @@ -180,6 +180,8 @@ int gpio_set_flags(enum gpio_signal signal, int flags) { const struct gpio_info *g = gpio_list + signal; + if (flags & GPIO_DEFAULT) + return EC_SUCCESS; if (flags & GPIO_OUTPUT) { /* Output */ /* Select open drain first, so that we don't glitch the signal diff --git a/chip/stm32/gpio-stm32f100.c b/chip/stm32/gpio-stm32f100.c index 8c071394e4..0cc79a0856 100644 --- a/chip/stm32/gpio-stm32f100.c +++ b/chip/stm32/gpio-stm32f100.c @@ -57,6 +57,8 @@ int gpio_set_flags(enum gpio_signal signal, int flags) const struct gpio_info *g = gpio_list + signal; uint32_t addr, cnf, mode, mask; + if (flags & GPIO_DEFAULT) + return EC_SUCCESS; gpio_config_info(g, &addr, &mode, &cnf); mask = REG32(addr) & ~(cnf | mode); diff --git a/chip/stm32/gpio-stm32l15x.c b/chip/stm32/gpio-stm32l15x.c index f5513dafb8..cb5f17a1d4 100644 --- a/chip/stm32/gpio-stm32l15x.c +++ b/chip/stm32/gpio-stm32l15x.c @@ -41,6 +41,8 @@ int gpio_pre_init(void) uint32_t mask2 = (g->mask * g->mask) | (g->mask * g->mask * 2); uint32_t val; + if (g->mask & GPIO_DEFAULT) + continue; val = STM32_GPIO_PUPDR_OFF(g->port) & ~mask2; if ((g->flags & GPIO_PULL_UP) == GPIO_PULL_UP) /* Pull Up = 01 */ diff --git a/include/gpio.h b/include/gpio.h index e03acfb0c9..0007e07cfa 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -25,7 +25,7 @@ #define GPIO_INT_BOTH 0x0040 /* Interrupt on both edges */ #define GPIO_INT_LOW 0x0080 /* Interrupt on low level */ #define GPIO_INT_HIGH 0x0100 /* Interrupt on high level */ - +#define GPIO_DEFAULT 0x0200 /* Don't set up on boot */ /* Common flag combinations */ #define GPIO_OUT_LOW GPIO_OUTPUT |