Declare which infoframes are supported via the .hdmi_write_infoframe()
interface. Return -EOPNOTSUPP if the driver is asked to write or clear
the unsupported InfoFrame.

Reviewed-by: Daniel Stone <dani...@collabora.com>
Acked-by: Daniel Stone <dani...@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.barysh...@oss.qualcomm.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c 
b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index 
39332c57f2c54296f39e27612544f4fbf923863f..9a195c479bcaf112f67b6a2f085402d0e33896de
 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -936,6 +936,7 @@ static int dw_hdmi_qp_bridge_clear_infoframe(struct 
drm_bridge *bridge,
                break;
        default:
                dev_dbg(hdmi->dev, "Unsupported infoframe type %x\n", type);
+               return -EOPNOTSUPP;
        }
 
        return 0;
@@ -961,7 +962,7 @@ static int dw_hdmi_qp_bridge_write_infoframe(struct 
drm_bridge *bridge,
 
        default:
                dev_dbg(hdmi->dev, "Unsupported infoframe type %x\n", type);
-               return 0;
+               return -EOPNOTSUPP;
        }
 }
 
@@ -1084,6 +1085,10 @@ struct dw_hdmi_qp *dw_hdmi_qp_bind(struct 
platform_device *pdev,
        hdmi->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
        hdmi->bridge.vendor = "Synopsys";
        hdmi->bridge.product = "DW HDMI QP TX";
+       hdmi->bridge.supported_infoframes =
+               DRM_CONNECTOR_INFOFRAME_AUDIO |
+               DRM_CONNECTOR_INFOFRAME_AVI |
+               DRM_CONNECTOR_INFOFRAME_DRM;
 
        hdmi->bridge.ddc = dw_hdmi_qp_i2c_adapter(hdmi);
        if (IS_ERR(hdmi->bridge.ddc))

-- 
2.47.3

Reply via email to