From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaud Patard (Rtp) Date: Fri, 20 Nov 2020 14:24:29 +0100 Subject: [patch v3 8/9] rockchip: video: edp: Add missing reset support References: <20201120132421.500365403@rtp-net.org> Message-ID: <20201120132824.012845278@rtp-net.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 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 #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -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);