]> Git Repo - J-u-boot.git/commitdiff
dm: gpio: Return error when pull up/down is requested but set_flags ops is not implme...
authorZixun LI <[email protected]>
Mon, 21 Oct 2024 15:04:51 +0000 (17:04 +0200)
committerTom Rini <[email protected]>
Wed, 4 Dec 2024 20:11:43 +0000 (14:11 -0600)
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]>
drivers/gpio/gpio-uclass.c

index 0213271e3a69d7d6b39837f9dca902149368672a..da929c33447b918493127fe74791e4e064a299e1 100644 (file)
@@ -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;
 
This page took 0.040913 seconds and 4 git commands to generate.