aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasily Khoruzhick2018-11-05 22:24:29 -0600
committerJagan Teki2018-11-13 10:38:23 -0600
commit8336a43792a103c13d939b3925cb75322911f7fb (patch)
tree82baa67470899e5e9402267b8db4b093020bc9f0 /drivers
parent20940ef2a397446a209350900d3bd618c3fd5b94 (diff)
downloadu-boot-8336a43792a103c13d939b3925cb75322911f7fb.tar.gz
u-boot-8336a43792a103c13d939b3925cb75322911f7fb.tar.xz
u-boot-8336a43792a103c13d939b3925cb75322911f7fb.zip
dm: video: bridge: don't fail to activate bridge if reset or sleep GPIO is missing
Both GPIOs are optional, so we shouldn't fail if any is missing. Without this fix reset is not deasserted if sleep GPIO is missing. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Tested-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Cc: Vagrant Cascadian <vagrant@debian.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/bridge/video-bridge-uclass.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/video/bridge/video-bridge-uclass.c b/drivers/video/bridge/video-bridge-uclass.c
index cd4959cc71..5fecb4cfd5 100644
--- a/drivers/video/bridge/video-bridge-uclass.c
+++ b/drivers/video/bridge/video-bridge-uclass.c
@@ -106,13 +106,19 @@ static int video_bridge_pre_probe(struct udevice *dev)
106int video_bridge_set_active(struct udevice *dev, bool active) 106int video_bridge_set_active(struct udevice *dev, bool active)
107{ 107{
108 struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev); 108 struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev);
109 int ret; 109 int ret = 0;
110 110
111 debug("%s: %d\n", __func__, active); 111 debug("%s: %d\n", __func__, active);
112 ret = dm_gpio_set_value(&uc_priv->sleep, !active); 112 if (uc_priv->sleep.dev) {
113 if (ret) 113 ret = dm_gpio_set_value(&uc_priv->sleep, !active);
114 return ret; 114 if (ret)
115 if (active) { 115 return ret;
116 }
117
118 if (!active)
119 return 0;
120
121 if (uc_priv->reset.dev) {
116 ret = dm_gpio_set_value(&uc_priv->reset, true); 122 ret = dm_gpio_set_value(&uc_priv->reset, true);
117 if (ret) 123 if (ret)
118 return ret; 124 return ret;