[U-Boot] [PATCH v2 2/5] dm: video: bridge: don't fail to activate bridge if reset or sleep GPIO is missing

Vasily Khoruzhick anarsoul at gmail.com
Wed Oct 17 05:09:29 UTC 2018


Both GPIOs are optional, so we shouldn't fail if any is missing. Without
this fix reset is not deasserted when sleep GPIO is missing.

Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>
---
 drivers/video/bridge/video-bridge-uclass.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/video/bridge/video-bridge-uclass.c b/drivers/video/bridge/video-bridge-uclass.c
index cd4959cc71..7542097769 100644
--- a/drivers/video/bridge/video-bridge-uclass.c
+++ b/drivers/video/bridge/video-bridge-uclass.c
@@ -109,10 +109,16 @@ int video_bridge_set_active(struct udevice *dev, bool active)
 	int ret;
 
 	debug("%s: %d\n", __func__, active);
-	ret = dm_gpio_set_value(&uc_priv->sleep, !active);
-	if (ret)
-		return ret;
-	if (active) {
+	if (uc_priv->sleep.dev) {
+		ret = dm_gpio_set_value(&uc_priv->sleep, !active);
+		if (ret)
+			return ret;
+	}
+
+	if (!active)
+		return 0;
+
+	if (uc_priv->reset.dev) {
 		ret = dm_gpio_set_value(&uc_priv->reset, true);
 		if (ret)
 			return ret;
-- 
2.19.0



More information about the U-Boot mailing list