]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: dw_hdmi: Extend the HPD detection
authorJagan Teki <jagan@edgeble.ai>
Wed, 17 Jan 2024 07:51:40 +0000 (13:21 +0530)
committerAnatolij Gustschin <agust@denx.de>
Sun, 21 Apr 2024 07:07:00 +0000 (09:07 +0200)
HPD detection on some DW HDMI designed 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>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
drivers/video/dw_hdmi.c
drivers/video/rockchip/rk_hdmi.c
drivers/video/sunxi/sunxi_dw_hdmi.c
include/dw_hdmi.h

index 4914ba61464d98fb684d6f0010b8f08404f1b258..3a3b9b7a21d2935e8c779974d7040f6df134e7a4 100644 (file)
@@ -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 */
index 84b6a7ebcf1b7893f90bc6d5016a756ff3e495d4..d31f6a4ff81b306d946cb58a253cc6893134baac 100644 (file)
@@ -113,11 +113,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;
 }
index 986e69d66b190c1b416a0251a3b6df3334144ab3..a5e8d39e98f87c173279bc2a7cf531c3429da699 100644 (file)
@@ -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);
 
index 17bdd2dbf9e7989951196d5a19ade7390e2d6f9f..ba2ce5ea7fe05d19458731460c067bdfe2d7f656 100644 (file)
@@ -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