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 <manimaran.a@microchip.com>
This commit is contained in:
Manimaran A 2023-08-08 17:09:48 +05:30 committed by Anas Nashif
commit aed0ecfd56

View file

@ -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;
}