dm: gpio: Return error when pull up/down is requested but set_flags ops is not implmentated
PATCH 1/1 dm: gpio: Return error when pull up/down is requested but set_flags ops is not implmentated
Currently in _dm_gpio_set_flags() when set_flags ops is not implemented direction_output()/_input() is used, but pull up/down is not supported by these ops.
Signed-off-by Zixun LI <[email protected]>
---
We have updated our AT91 BSP to use DM, on field testing few boards went into a failed state due to gpio pullup is not enabled. A floating gpio doesn't always fail and can sometimes be hard to diagostic.
--- drivers/gpio/gpio-uclass.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpio/gpio-uclass.c +3 -0
@@ -661,6 +661,9 @@ static int _dm_gpio_set_flags(struct gpio_desc *desc, ulong flags)if (ops->set_flags) { ret = ops->set_flags (dev, desc->offset, flags); }else { +if (flags &GPIOD_MASK_PULL ) +return -EINVAL ; +if (flags &GPIOD_IS_OUT ) {bool value = flags &GPIOD_IS_OUT_ACTIVE ;
Signature · 1 line
2.46.2
Quoted 5 lines · Zixun LI
Currently in
_dm_gpio_set_flags()whenset_flagsops is not implemented direction_output()/_input() is used, but pull up/down is not supported by these ops.
Applied to u-boot/next, thanks!
Signature · 1 line
Tom