All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Subject: [PATCH 1/2] drm: rcar-du: lvds: fix LVDS startup on R-Car gen3
Date: Fri, 12 Jan 2018 23:12:04 +0300	[thread overview]
Message-ID: <20180112201550.368547609@cogentembedded.com> (raw)

[-- Attachment #1: drm-rcar-du-lvds-fix-LVDS-startup-on-R-Car-gen3.patch --]
[-- Type: text/plain, Size: 1873 bytes --]

According to the latest revisions of the R-Car gen3 manual, the LVDS mode
must be set before the LVDS I/O pins are enabled, not after --  fix  the
gen3 LVDS startup sequence accordingly...

While  at it,  also fix the comment  preceding the first LVDCR0 write in
the R-Car gen2 startup code that still talks about hardcoding the LVDS
mode 0...

Fixes: e947eccbeba4 ("drm: rcar-du: Add support for LVDS mode selection")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Index: linux/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
===================================================================
--- linux.orig/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
+++ linux/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
@@ -60,8 +60,8 @@ static void rcar_du_lvdsenc_start_gen2(s
 	rcar_lvds_write(lvds, LVDPLLCR, pllcr);
 
 	/*
-	 * Select the input, hardcode mode 0, enable LVDS operation and turn
-	 * bias circuitry on.
+	 * Set the  LVDS mode, select the input, enable LVDS operation,
+	 * and turn bias circuitry on.
 	 */
 	lvdcr0 = (lvds->mode << LVDCR0_LVMD_SHIFT) | LVDCR0_BEN | LVDCR0_LVEN;
 	if (rcrtc->index == 2)
@@ -106,6 +106,9 @@ static void rcar_du_lvdsenc_start_gen3(s
 
 	rcar_lvds_write(lvds, LVDPLLCR, pllcr);
 
+	lvdcr0 = lvds->mode << LVDCR0_LVMD_SHIFT;
+	rcar_lvds_write(lvds, LVDCR0, lvdcr0);
+
 	/* Turn all the channels on. */
 	rcar_lvds_write(lvds, LVDCR1,
 			LVDCR1_CHSTBY(3) | LVDCR1_CHSTBY(2) |
@@ -115,7 +118,8 @@ static void rcar_du_lvdsenc_start_gen3(s
 	 * Turn the PLL on, set it to LVDS normal mode, wait for the startup
 	 * delay and turn the output on.
 	 */
-	lvdcr0 = (lvds->mode << LVDCR0_LVMD_SHIFT) | LVDCR0_PLLON;
+
+	lvdcr0 = | LVDCR0_PLLON;
 	rcar_lvds_write(lvds, LVDCR0, lvdcr0);
 
 	lvdcr0 |= LVDCR0_PWD;

             reply	other threads:[~2018-01-12 20:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 20:12 Sergei Shtylyov [this message]
2018-01-12 20:21 ` [PATCH 1/2] drm: rcar-du: lvds: fix LVDS startup on R-Car gen3 Sergei Shtylyov
2018-01-12 20:21   ` Sergei Shtylyov
2018-01-12 21:51 ` Laurent Pinchart
2018-01-12 22:15   ` Laurent Pinchart
2018-01-12 22:15     ` Laurent Pinchart
2018-01-13  9:25     ` Sergei Shtylyov
2018-01-16 15:42       ` Laurent Pinchart
2018-02-14 16:52         ` Laurent Pinchart
2018-02-14 16:52           ` Laurent Pinchart
2018-01-13  9:17   ` Sergei Shtylyov

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=20180112201550.368547609@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.