On 5/18/26 21:47, Jonas Karlman wrote:
G12A added support for RX-SENSE, status for both HPD and RX-SENSE is
reported in the TOP_STAT0 register.

Limit read_hpd() phy ops to only report connected status based on the
HPD status bit in TOP_STAT0, to help ensure that EDID can be read from
the sink in the connector detect() func.

Fixes: 3b7c1237a72a ("drm/meson: Add G12A support for the DW-HDMI Glue")
Signed-off-by: Jonas Karlman <[email protected]>
---
  drivers/gpu/drm/meson/meson_dw_hdmi.c | 6 ++++--
  drivers/gpu/drm/meson/meson_dw_hdmi.h | 3 +++
  2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c 
b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index 2a8756da569b..993f6d5d4b29 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -457,9 +457,11 @@ static enum drm_connector_status dw_hdmi_read_hpd(struct 
dw_hdmi *hdmi,
                             void *data)
  {
        struct meson_dw_hdmi *dw_hdmi = (struct meson_dw_hdmi *)data;
+       unsigned int stat;
- return !!dw_hdmi->data->top_read(dw_hdmi, HDMITX_TOP_STAT0) ?
-               connector_status_connected : connector_status_disconnected;
+       stat = dw_hdmi->data->top_read(dw_hdmi, HDMITX_TOP_STAT0);
+       return stat & HDMITX_TOP_STAT0_HPD ? connector_status_connected :
+                                            connector_status_disconnected;
  }
static void dw_hdmi_setup_hpd(struct dw_hdmi *hdmi,
diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.h 
b/drivers/gpu/drm/meson/meson_dw_hdmi.h
index 08e1c14e4ea0..cb4616daf667 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.h
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.h
@@ -157,4 +157,7 @@
   */
  #define HDMITX_TOP_STAT0                        (0x00E)
+#define HDMITX_TOP_STAT0_HPD BIT(0)
+#define HDMITX_TOP_STAT0_RXSENSE       BIT(1)
+
  #endif /* __MESON_DW_HDMI_H */

Thanks, pretty sure the RXSENSE needs some setup in the PHY to work
and Amlogic never enabled it, but this version is clearly better.

Reviewed-by: Neil Armstrong <[email protected]>

Thanks,
Neil

Reply via email to