From aed0ecfd56eb8be4b4933cf0602b8bf324c88765 Mon Sep 17 00:00:00 2001 From: Manimaran A Date: Tue, 8 Aug 2023 17:09:48 +0530 Subject: [PATCH] drivers: gpio: mchp: Twister fix for test_input_output failure Added logic to return ENOTSUP, if input-output GPIO direction requested. Signed-off-by: Manimaran A --- drivers/gpio/gpio_mchp_xec_v2.c | 5 +++++ 1 file changed, 5 insertions(+) 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; }