public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jagan Teki <jagan@amarulasolutions.com>
To: Anatolij Gustschin <agust@denx.de>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Andre Przywara <andre.przywara@arm.com>,
	Kever Yang <kever.yang@rock-chips.com>,
	Simon Glass <sjg@chromium.org>, Heiko Stuebner <heiko@sntech.de>,
	Andy Yan <andyshrk@163.com>, Robin Murphy <robin.murphy@arm.com>
Cc: Da Xue <da.xue@libretech.co>,
	u-boot@lists.denx.de, Jagan Teki <jagan@edgeble.ai>
Subject: [PATCH v3 03/17] video: dw_hdmi: Extend the HPD detection
Date: Wed, 17 Jan 2024 13:21:40 +0530	[thread overview]
Message-ID: <20240117075154.58747-4-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20240117075154.58747-1-jagan@amarulasolutions.com>

From: Jagan Teki <jagan@edgeble.ai>

HPD detection on some DW HDMIdesigned SoC's would need to read and
setup the HPD status explicitly.

So, extend the HPD detection code by adding the dw_hdmi_detect_hpd
function and move the default detection code caller there.

The new read and setup hdp will integrate the same function in
later patches.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
---
Changes for v3, v2:
- none

 drivers/video/dw_hdmi.c             | 13 +++++++++++++
 drivers/video/rockchip/rk_hdmi.c    |  8 +++-----
 drivers/video/sunxi/sunxi_dw_hdmi.c |  8 +++-----
 include/dw_hdmi.h                   |  1 +
 4 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/video/dw_hdmi.c b/drivers/video/dw_hdmi.c
index 4914ba6146..3a3b9b7a21 100644
--- a/drivers/video/dw_hdmi.c
+++ b/drivers/video/dw_hdmi.c
@@ -936,6 +936,19 @@ int dw_hdmi_phy_wait_for_hpd(struct dw_hdmi *hdmi)
 	return -1;
 }
 
+int dw_hdmi_detect_hpd(struct dw_hdmi *hdmi)
+{
+	int ret;
+
+	ret = dw_hdmi_phy_wait_for_hpd(hdmi);
+	if (ret < 0) {
+		debug("hdmi can not get hpd signal\n");
+		return -ENODEV;
+	}
+
+	return 0;
+}
+
 void dw_hdmi_phy_init(struct dw_hdmi *hdmi)
 {
 	/* enable phy i2cm done irq */
diff --git a/drivers/video/rockchip/rk_hdmi.c b/drivers/video/rockchip/rk_hdmi.c
index d5b5a529d2..16f6303513 100644
--- a/drivers/video/rockchip/rk_hdmi.c
+++ b/drivers/video/rockchip/rk_hdmi.c
@@ -114,11 +114,9 @@ int rk_hdmi_probe(struct udevice *dev)
 	dw_hdmi_init(hdmi);
 	dw_hdmi_phy_init(hdmi);
 
-	ret = dw_hdmi_phy_wait_for_hpd(hdmi);
-	if (ret < 0) {
-		debug("hdmi can not get hpd signal\n");
-		return -1;
-	}
+	ret = dw_hdmi_detect_hpd(hdmi);
+	if (ret < 0)
+		return ret;
 
 	return 0;
 }
diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c
index 986e69d66b..a5e8d39e98 100644
--- a/drivers/video/sunxi/sunxi_dw_hdmi.c
+++ b/drivers/video/sunxi/sunxi_dw_hdmi.c
@@ -358,11 +358,9 @@ static int sunxi_dw_hdmi_probe(struct udevice *dev)
 
 	sunxi_dw_hdmi_phy_init(&priv->hdmi);
 
-	ret = dw_hdmi_phy_wait_for_hpd(&priv->hdmi);
-	if (ret < 0) {
-		debug("hdmi can not get hpd signal\n");
-		return -1;
-	}
+	ret = dw_hdmi_detect_hpd(&priv->hdmi);
+	if (ret < 0)
+		return ret;
 
 	dw_hdmi_init(&priv->hdmi);
 
diff --git a/include/dw_hdmi.h b/include/dw_hdmi.h
index 17bdd2dbf9..ba2ce5ea7f 100644
--- a/include/dw_hdmi.h
+++ b/include/dw_hdmi.h
@@ -562,5 +562,6 @@ void dw_hdmi_phy_init(struct dw_hdmi *hdmi);
 int dw_hdmi_enable(struct dw_hdmi *hdmi, const struct display_timing *edid);
 int dw_hdmi_read_edid(struct dw_hdmi *hdmi, u8 *buf, int buf_size);
 void dw_hdmi_init(struct dw_hdmi *hdmi);
+int dw_hdmi_detect_hpd(struct dw_hdmi *hdmi);
 
 #endif
-- 
2.25.1


  parent reply	other threads:[~2024-01-17  7:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17  7:51 [PATCH v3 00/17] video: dw_hdmi: Support Vendor PHY Jagan Teki
2024-01-17  7:51 ` [PATCH v3 01/17] video: rockchip: hdmi: Detect hpd after controller init Jagan Teki
2024-01-17  7:51 ` [PATCH v3 02/17] video: dw_hdmi: Add Vendor PHY handling Jagan Teki
2024-01-17  8:58   ` Neil Armstrong
2024-01-17  7:51 ` Jagan Teki [this message]
2024-01-17  8:59   ` [PATCH v3 03/17] video: dw_hdmi: Extend the HPD detection Neil Armstrong
2024-01-17  7:51 ` [PATCH v3 04/17] video: dw_hdmi: Add read_hpd hook Jagan Teki
2024-01-17  8:59   ` Neil Armstrong
2024-01-17  7:51 ` [PATCH v3 05/17] video: dw_hdmi: Add setup_hpd hook Jagan Teki
2024-01-17  8:59   ` Neil Armstrong
2024-01-17  7:51 ` [PATCH v3 06/17] video: rockchip: vop: Simplify rkvop_enable Jagan Teki
2024-01-17  7:51 ` [PATCH v3 07/17] video: rockchip: vop: Add win offset support Jagan Teki
2024-01-17  7:51 ` [PATCH v3 08/17] video: rockchip: vop: Add dsp " Jagan Teki
2024-01-17  7:51 ` [PATCH v3 09/17] clk: rockchip: rk3328: Add VOP clk support Jagan Teki
2024-01-17  7:51 ` [PATCH v3 10/17] clk: rk3328: Add get hdmiphy clock Jagan Teki
2024-01-17  7:51 ` [PATCH v3 11/17] phy: rockchip: Add Rockchip INNO HDMI PHY driver Jagan Teki
2024-01-17  7:51 ` [PATCH v3 12/17] video: rockchip: Add rk3328 hdmi support Jagan Teki
2024-01-17  7:51 ` [PATCH v3 13/17] video: rockchip: Add rk3328 vop support Jagan Teki
2024-01-17  7:51 ` [PATCH v3 14/17] ARM: dts: rk3328: Enable VOP for bootph-all Jagan Teki
2024-02-19 17:21   ` Jonas Karlman
2024-02-19 18:32     ` Jagan Teki
2024-01-17  7:51 ` [PATCH v3 15/17] rockchip: Enable preconsole for rk3328 Jagan Teki
2024-01-17  7:51 ` [PATCH v3 16/17] configs: evb-rk3328: Enable vidconsole " Jagan Teki
2024-01-17  7:51 ` [PATCH v3 17/17] configs: Enable HDMI Out for ROC-RK3328-CC Jagan Teki
2024-02-19 11:49 ` [PATCH v3 00/17] video: dw_hdmi: Support Vendor PHY Jagan Teki
2024-03-14  9:25   ` Jagan Teki
2024-04-20 23:19     ` Anatolij Gustschin

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=20240117075154.58747-4-jagan@amarulasolutions.com \
    --to=jagan@amarulasolutions.com \
    --cc=agust@denx.de \
    --cc=andre.przywara@arm.com \
    --cc=andyshrk@163.com \
    --cc=da.xue@libretech.co \
    --cc=heiko@sntech.de \
    --cc=jagan@edgeble.ai \
    --cc=kever.yang@rock-chips.com \
    --cc=neil.armstrong@linaro.org \
    --cc=robin.murphy@arm.com \
    --cc=sjg@chromium.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