mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-18 19:04:38 +00:00
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 <admin@hifiphile.com>
This commit is contained in:
parent
15299fa5dd
commit
3c69a95b9a
1 changed files with 3 additions and 0 deletions
|
@ -705,6 +705,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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue