public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
To: u-boot@lists.denx.de
Subject: [patch v3 8/9] rockchip: video: edp: Add missing reset support
Date: Fri, 20 Nov 2020 14:24:29 +0100	[thread overview]
Message-ID: <20201120132824.012845278@rtp-net.org> (raw)
In-Reply-To: 20201120132421.500365403@rtp-net.org

In order to ensure that the eDP registers are in correct state,
add missing support for the eDP reset lines found in the device-tree.


Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Index: u-boot/drivers/video/rockchip/rk_edp.c
===================================================================
--- u-boot.orig/drivers/video/rockchip/rk_edp.c
+++ u-boot/drivers/video/rockchip/rk_edp.c
@@ -8,11 +8,13 @@
 #include <clk.h>
 #include <display.h>
 #include <dm.h>
+#include <dm/device_compat.h>
 #include <edid.h>
 #include <log.h>
 #include <malloc.h>
 #include <panel.h>
 #include <regmap.h>
+#include <reset.h>
 #include <syscon.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
@@ -1053,6 +1055,7 @@ static int rk_edp_probe(struct udevice *
 	struct rk_edp_priv *priv = dev_get_priv(dev);
 	struct rk3288_edp *regs = priv->regs;
 	struct rockchip_dp_data *edp_data = (struct rockchip_dp_data *)dev_get_driver_data(dev);
+	struct reset_ctl dp_rst;
 
 	struct clk clk;
 	int ret;
@@ -1065,6 +1068,25 @@ static int rk_edp_probe(struct udevice *
 		return ret;
 	}
 
+	ret = reset_get_by_name(dev, "dp", &dp_rst);
+	if (ret) {
+		dev_err(dev, "failed to get dp reset (ret=%d)\n", ret);
+		return ret;
+	}
+
+	ret = reset_assert(&dp_rst);
+	if (ret) {
+		dev_err(dev, "failed to assert dp reset (ret=%d)\n", ret);
+		return ret;
+	}
+	udelay(20);
+
+	ret = reset_deassert(&dp_rst);
+	if (ret) {
+		dev_err(dev, "failed to deassert dp reset (ret=%d)\n", ret);
+		return ret;
+	}
+
 	int vop_id = uc_plat->source_id;
 	debug("%s, uc_plat=%p, vop_id=%u\n", __func__, uc_plat, vop_id);
 

  parent reply	other threads:[~2020-11-20 13:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 13:24 [patch v3 0/9] rk3399 (Pinebook pro) EDP support Arnaud Patard
2020-11-20 13:24 ` [patch v3 1/9] rockchip: video: vop: Use endpoint compatible string to find VOP mode Arnaud Patard
2020-11-20 13:24 ` [patch v3 2/9] rockchip: video: edp: Add rk3399 support Arnaud Patard
2020-11-20 13:24 ` [patch v3 3/9] ockchip: video: edp: Change interrupt polarity configuration Arnaud Patard
2021-01-21 13:08   ` Kever Yang
2020-11-20 13:24 ` [patch v3 4/9] ockchip: video: vop: Reserve efi fb memory Arnaud Patard
2021-01-21 13:06   ` Kever Yang
2020-11-20 13:24 ` [patch v3 5/9] rockchip: Pinebook Pro: Enable edp Arnaud Patard
2020-11-20 13:24 ` [patch v3 6/9] rockchip: pwm: Fix default polarity Arnaud Patard
2020-11-20 13:24 ` [patch v3 7/9] rockchip: video: vop: Fix format of fbbase in debug string Arnaud Patard
2021-01-21 12:52   ` Kever Yang
2020-11-20 13:24 ` Arnaud Patard [this message]
2020-11-20 13:24 ` [patch v3 9/9] rockchip: videp: vop: Add reset support Arnaud Patard
2021-01-21 12:50   ` Kever Yang
2021-01-25 15:04 ` [patch v3 0/9] rk3399 (Pinebook pro) EDP support Peter Robinson

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=20201120132824.012845278@rtp-net.org \
    --to=arnaud.patard@rtp-net.org \
    --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