public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vasily Khoruzhick <anarsoul@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] Revert "sunxi: video: HDMI: split VSYNC and HSYNC polarity settings"
Date: Sat, 28 Apr 2018 14:57:28 -0700	[thread overview]
Message-ID: <20180428215729.22048-2-anarsoul@gmail.com> (raw)
In-Reply-To: <20180428215729.22048-1-anarsoul@gmail.com>

This reverts commit 64089178219371a512ddca8016d78bfdbe84565d.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 drivers/video/sunxi/sunxi_dw_hdmi.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c
index 4f01d1bded..33920a2b67 100644
--- a/drivers/video/sunxi/sunxi_dw_hdmi.c
+++ b/drivers/video/sunxi/sunxi_dw_hdmi.c
@@ -304,11 +304,15 @@ static int sunxi_dw_hdmi_enable(struct udevice *dev, int panel_bpp,
 
 	sunxi_dw_hdmi_lcdc_init(priv->mux, edid, panel_bpp);
 
-	if (edid->flags & DISPLAY_FLAGS_HSYNC_LOW)
-		setbits_le32(&phy->pol, 0x200);
-
-	if (edid->flags & DISPLAY_FLAGS_VSYNC_LOW)
-		setbits_le32(&phy->pol, 0x100);
+	/*
+	 * Condition in original code is a bit weird. This is attempt
+	 * to make it more reasonable and it works. It could be that
+	 * bits and conditions are related and should be separated.
+	 */
+	if (!((edid->flags & DISPLAY_FLAGS_HSYNC_HIGH) &&
+	      (edid->flags & DISPLAY_FLAGS_VSYNC_HIGH))) {
+		setbits_le32(&phy->pol, 0x300);
+	}
 
 	setbits_le32(&phy->ctrl, 0xf << 12);
 
-- 
2.17.0

  reply	other threads:[~2018-04-28 21:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-28 21:57 [U-Boot] [PATCH 0/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings Vasily Khoruzhick
2018-04-28 21:57 ` Vasily Khoruzhick [this message]
2018-04-28 21:57 ` [U-Boot] [PATCH 2/2] " Vasily Khoruzhick
2018-05-02 11:01 ` [U-Boot] [PATCH 0/2] " Anatolij Gustschin
2018-05-02 14:47   ` Vasily Khoruzhick
2018-05-02 14:54     ` Jernej Škrabec

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=20180428215729.22048-2-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