diff --git a/drivers/gpio/gpio_mchp_xec_v2.c b/drivers/gpio/gpio_mchp_xec_v2.c index 0a4711e4669..d24e9449708 100644 --- a/drivers/gpio/gpio_mchp_xec_v2.c +++ b/drivers/gpio/gpio_mchp_xec_v2.c @@ -94,6 +94,11 @@ static int gpio_xec_validate_flags(gpio_flags_t flags) return -ENOTSUP; } + if ((flags & (GPIO_INPUT | GPIO_OUTPUT)) + == (GPIO_INPUT | GPIO_OUTPUT)) { + return -ENOTSUP; + } + if ((flags & GPIO_OUTPUT_INIT_LOW) && (flags & GPIO_OUTPUT_INIT_HIGH)) { return -EINVAL; }