]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: bridge: Allow GPIOs to be optional
authorSimon Glass <sjg@chromium.org>
Fri, 22 Jan 2016 02:44:53 +0000 (19:44 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 22 Jan 2016 03:42:36 +0000 (20:42 -0700)
Some video bridges will not have GPIOs to control reset, etc. Allow these
to be optional.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/video/bridge/video-bridge-uclass.c

index 6c5990f54ce19efe2793590a6e9f388a0466f5d4..07270bac9ebfb3affd07317b7b8cf875563e72ae 100644 (file)
@@ -55,7 +55,8 @@ static int video_bridge_pre_probe(struct udevice *dev)
                                   &uc_priv->sleep, GPIOD_IS_OUT);
        if (ret) {
                debug("%s: Could not decode sleep-gpios (%d)\n", __func__, ret);
-               return ret;
+               if (ret != -ENOENT)
+                       return ret;
        }
        /*
         * Drop this for now as we do not have driver model pinctrl support
@@ -70,7 +71,8 @@ static int video_bridge_pre_probe(struct udevice *dev)
                                   GPIOD_IS_OUT);
        if (ret) {
                debug("%s: Could not decode reset-gpios (%d)\n", __func__, ret);
-               return ret;
+               if (ret != -ENOENT)
+                       return ret;
        }
        /*
         * Drop this for now as we do not have driver model pinctrl support
@@ -83,9 +85,10 @@ static int video_bridge_pre_probe(struct udevice *dev)
         */
        ret = gpio_request_by_name(dev, "hotplug-gpios", 0, &uc_priv->hotplug,
                                   GPIOD_IS_IN);
-       if (ret && ret != -ENOENT) {
+       if (ret) {
                debug("%s: Could not decode hotplug (%d)\n", __func__, ret);
-               return ret;
+               if (ret != -ENOENT)
+                       return ret;
        }
 
        return 0;