diff options
-rw-r--r-- | chip/npcx/gpio.c | 2 | ||||
-rw-r--r-- | common/gpio.c | 2 | ||||
-rw-r--r-- | include/config.h | 3 | ||||
-rw-r--r-- | include/gpio.h | 6 |
4 files changed, 10 insertions, 3 deletions
diff --git a/chip/npcx/gpio.c b/chip/npcx/gpio.c index 8a76043d3d..6354d06ab1 100644 --- a/chip/npcx/gpio.c +++ b/chip/npcx/gpio.c @@ -330,7 +330,7 @@ void gpio_set_level(enum gpio_signal signal, int value) NPCX_PDOUT(gpio_list[signal].port) &= ~gpio_list[signal].mask; } -#ifdef CONFIG_CMD_GPIO_EXTENDED +#ifdef CONFIG_GPIO_GET_EXTENDED int gpio_get_flags_by_mask(uint32_t port, uint32_t mask) { uint32_t flags = 0; diff --git a/common/gpio.c b/common/gpio.c index 60d4973d61..e20f1f8c93 100644 --- a/common/gpio.c +++ b/common/gpio.c @@ -108,7 +108,7 @@ void gpio_set_flags(enum gpio_signal signal, int flags) gpio_set_flags_by_mask(g->port, g->mask, flags); } -#ifdef CONFIG_CMD_GPIO_EXTENDED +#ifdef CONFIG_GPIO_GET_EXTENDED int gpio_get_flags(enum gpio_signal signal) { const struct gpio_info *g = gpio_list + signal; diff --git a/include/config.h b/include/config.h index 5a62cb5728..aaf134c02f 100644 --- a/include/config.h +++ b/include/config.h @@ -1803,6 +1803,9 @@ */ #undef CONFIG_GPIO_INIT_POWER_ON_DELAY_MS +/* Support getting gpio flags. */ +#undef CONFIG_GPIO_GET_EXTENDED + /* Do we want to detect the lid angle? */ #undef CONFIG_LID_ANGLE diff --git a/include/gpio.h b/include/gpio.h index f01cd5147e..c778c5d3a8 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -161,7 +161,11 @@ int gpio_is_implemented(enum gpio_signal signal); */ void gpio_set_flags(enum gpio_signal signal, int flags); -#ifdef CONFIG_CMD_GPIO_EXTENDED +#if defined(CONFIG_CMD_GPIO_EXTENDED) && !defined(CONFIG_GPIO_GET_EXTENDED) +#define CONFIG_GPIO_GET_EXTENDED +#endif + +#ifdef CONFIG_GPIO_GET_EXTENDED /** * Get the current flags for a signal. * |