From: Ulrich Hecht <uli+renesas@fpond.eu>
To: laurent.pinchart@ideasonboard.com
Cc: linux-renesas-soc@vger.kernel.org,
kieran.bingham+renesas@ideasonboard.com,
jacopo+renesas@jmondi.org, Ulrich Hecht <uli+renesas@fpond.eu>,
dri-devel@lists.freedesktop.org
Subject: [PROTO][PATCH 08/10] drm: rcar-du: lvds: Handle LVDS interface reset
Date: Tue, 14 Aug 2018 15:50:02 +0200 [thread overview]
Message-ID: <1534254604-24204-9-git-send-email-uli+renesas@fpond.eu> (raw)
In-Reply-To: <1534254604-24204-1-git-send-email-uli+renesas@fpond.eu>
From: Jacopo Mondi <jacopo+renesas@jmondi.org>
The processor manual prescribes to clear reset of LVDS interface in CPG/MSSR
module before display on, and to assert the same reset line at display off
time, to have the module resuming in a known state.
The module is said to be in "standby state" at initialization time, and this
requires, according to section 37.3.7 of the manual, to de-assert the reset to
have it functional.
Based on the original patch from
Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Ulrich Hecht <uli+renesas@fpond.eu>
---
drivers/gpu/drm/rcar-du/rcar_lvds.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index cd55576..f6a4f9c 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -14,6 +14,7 @@
#include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
+#include <linux/reset.h>
#include <linux/slab.h>
#include <drm/drm_atomic.h>
@@ -55,6 +56,7 @@ struct rcar_lvds {
void __iomem *mmio;
struct clk *clock;
+ struct reset_control *rst;
bool enabled;
struct drm_display_mode display_mode;
@@ -385,6 +387,12 @@ static void rcar_lvds_enable(struct drm_bridge *bridge)
if (ret < 0)
return;
+ ret = reset_control_deassert(lvds->rst);
+ if (ret < 0) {
+ clk_disable_unprepare(lvds->clock);
+ return;
+ }
+
/*
* Hardcode the channels and control signals routing for now.
*
@@ -476,6 +484,7 @@ static void rcar_lvds_disable(struct drm_bridge *bridge)
rcar_lvds_write(lvds, LVDCR1, 0);
rcar_lvds_write(lvds, LVDPLLCR, 0);
+ reset_control_assert(lvds->rst);
clk_disable_unprepare(lvds->clock);
lvds->enabled = false;
@@ -692,6 +701,12 @@ static int rcar_lvds_probe(struct platform_device *pdev)
return PTR_ERR(lvds->clock);
}
+ lvds->rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
+ if (IS_ERR(lvds->rst)) {
+ dev_err(&pdev->dev, "failed to get reset\n");
+ return PTR_ERR(lvds->rst);
+ }
+
drm_bridge_add(&lvds->bridge);
return 0;
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-08-14 13:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 13:49 [PROTO][PATCH 00/10] R-Car D3 LVDS/HDMI support (with PLL) Ulrich Hecht
2018-08-14 13:49 ` [PROTO][PATCH 01/10] drm: rcar-du: Add clk_set_rate for external clock device Ulrich Hecht
2018-08-20 10:10 ` Laurent Pinchart
2018-08-14 13:49 ` [PROTO][PATCH 02/10] drm: rcar-du: Add r8a77995 device support Ulrich Hecht
2018-08-20 8:39 ` Laurent Pinchart
2018-08-14 13:49 ` [PROTO][PATCH 03/10] drm: rcar-du: Fix digital RGB routing for R8A77995 Ulrich Hecht
2018-08-20 9:25 ` Laurent Pinchart
2018-08-14 13:49 ` [PROTO][PATCH 04/10] drm: rcar-du: lvds: LVDS PLL support Ulrich Hecht
2018-08-20 10:48 ` Laurent Pinchart
2018-08-14 13:49 ` [PROTO][PATCH 05/10] drm/bridge: adv7511: Add max-clock, min-vrefresh options Ulrich Hecht
2018-08-20 9:28 ` Laurent Pinchart
2018-08-21 8:03 ` Ulrich Hecht
2018-08-21 8:09 ` Laurent Pinchart
2018-08-22 9:13 ` Ulrich Hecht
2018-08-22 14:00 ` Laurent Pinchart
2018-08-14 13:50 ` [PROTO][PATCH 06/10] drm: rcar-du: Fix procedure for extal and dotclkin selection Ulrich Hecht
2018-08-20 9:40 ` Laurent Pinchart
2018-08-14 13:50 ` [PROTO][PATCH 07/10] arm64: dts: r8a77995-draak: set external clock for DU Ulrich Hecht
2018-08-20 10:51 ` Laurent Pinchart
2018-08-14 13:50 ` Ulrich Hecht [this message]
2018-08-14 13:50 ` [PROTO][PATCH 09/10] arm64: dts: renesas: r8a77995: Add LVDS support Ulrich Hecht
2018-08-14 13:50 ` [PROTO][PATCH 10/10] arm64: dts: renesas: r8a77995-draak: add HDMI output Ulrich Hecht
2018-08-20 11:01 ` Laurent Pinchart
2018-08-20 9:50 ` [PROTO][PATCH 00/10] R-Car D3 LVDS/HDMI support (with PLL) Laurent Pinchart
2018-08-21 8:02 ` Ulrich Hecht
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=1534254604-24204-9-git-send-email-uli+renesas@fpond.eu \
--to=uli+renesas@fpond.eu \
--cc=dri-devel@lists.freedesktop.org \
--cc=jacopo+renesas@jmondi.org \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-renesas-soc@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).