From: Vasily Khoruzhick <anarsoul@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/5] dm: video: bridge: don't fail to activate bridge if reset or sleep GPIO is missing
Date: Tue, 16 Oct 2018 22:09:29 -0700 [thread overview]
Message-ID: <20181017050932.11138-3-anarsoul@gmail.com> (raw)
In-Reply-To: <20181017050932.11138-1-anarsoul@gmail.com>
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@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
next prev parent reply other threads:[~2018-10-17 5:09 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-17 5:09 [U-Boot] [PATCH v2 0/5] Add support for Pinebook Vasily Khoruzhick
2018-10-17 5:09 ` [U-Boot] [PATCH v2 1/5] mmc: sunxi: A64: add support for automatic delay calibration Vasily Khoruzhick
2018-10-18 0:22 ` André Przywara
2018-10-17 5:09 ` Vasily Khoruzhick [this message]
2018-10-18 0:22 ` [U-Boot] [PATCH v2 2/5] dm: video: bridge: don't fail to activate bridge if reset or sleep GPIO is missing André Przywara
2018-10-17 5:09 ` [U-Boot] [PATCH v2 3/5] sunxi: DT: A64: update device tree file for Allwinner A64 SoC Vasily Khoruzhick
2018-10-17 15:03 ` Vasily Khoruzhick
2018-10-17 15:13 ` Jernej Škrabec
2018-10-17 15:18 ` Andre Przywara
2018-10-17 15:29 ` Maxime Ripard
2018-10-17 16:54 ` Andre Przywara
2018-10-17 17:09 ` Vasily Khoruzhick
2018-10-17 17:15 ` Andre Przywara
2018-10-17 15:40 ` Vasily Khoruzhick
2018-10-18 0:21 ` André Przywara
2018-10-17 5:09 ` [U-Boot] [PATCH v2 4/5] sun50i: A64: add support for R_I2C controller Vasily Khoruzhick
2018-10-18 0:22 ` André Przywara
2018-10-17 5:09 ` [U-Boot] [PATCH v2 5/5] sunxi: DT: add support for Pinebook Vasily Khoruzhick
2018-10-17 14:37 ` Maxime Ripard
2018-10-17 15:13 ` Vasily Khoruzhick
2018-10-17 15:22 ` Jernej Škrabec
2018-10-17 15:37 ` Vasily Khoruzhick
2018-10-18 0:23 ` André Przywara
2018-10-18 4:48 ` Vasily Khoruzhick
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181017050932.11138-3-anarsoul@gmail.com \
--to=anarsoul@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox