diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c index 70ab4fbdc23e..48fc36d56bc2 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -262,6 +263,8 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev) if (IS_ERR(cec->adap)) return PTR_ERR(cec->adap); + dw_hdmi_set_cec_adap(cec->hdmi, cec->adap); + /* override the module pointer */ cec->adap->owner = THIS_MODULE; diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index fa9daab3499b..c1cb2f3f0171 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -313,6 +313,7 @@ struct dw_hdmi { struct mutex cec_notifier_mutex; struct cec_notifier *cec_notifier; + struct cec_adapter *cec_adap; hdmi_codec_plugged_cb plugged_cb; struct device *codec_dev; @@ -390,7 +391,13 @@ static void repo_hpd_event(struct work_struct *p_work) mutex_unlock(&hdmi->mutex); if (hdmi->bridge.dev) { - drm_helper_hpd_irq_event(hdmi->bridge.dev); + bool change; + + change = drm_helper_hpd_irq_event(hdmi->bridge.dev); + if (change && hdmi->cec_adap->devnode.registered) + cec_queue_pin_hpd_event(hdmi->cec_adap, + hdmi->hpd_state, + ktime_get()); drm_bridge_hpd_notify(&hdmi->bridge, status); } @@ -3459,6 +3466,12 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = { .get_edid = dw_hdmi_bridge_get_edid, }; +void dw_hdmi_set_cec_adap(struct dw_hdmi *hdmi, struct cec_adapter *adap) +{ + hdmi->cec_adap = adap; +} +EXPORT_SYMBOL_GPL(dw_hdmi_set_cec_adap); + /* ----------------------------------------------------------------------------- * IRQ Handling */ diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index d696e9eb13ba..fca0aa96e7f2 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -8,6 +8,7 @@ #include #include +#include struct drm_display_info; struct drm_display_mode; @@ -236,5 +237,6 @@ enum drm_connector_status dw_hdmi_phy_read_hpd(struct dw_hdmi *hdmi, void dw_hdmi_phy_update_hpd(struct dw_hdmi *hdmi, void *data, bool force, bool disabled, bool rxsense); void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data); +void dw_hdmi_set_cec_adap(struct dw_hdmi *hdmi, struct cec_adapter *adap); #endif /* __IMX_HDMI_H__ */