drm: bridge: dw-hdmi: Support report cec hpd

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I45a5a45623f2eaf3f66a87dcd35c9fbeb20f7c77
This commit is contained in:
Algea Cao
2021-08-10 17:10:45 +08:00
committed by Tao Huang
parent c1f9ea51ed
commit 5fe797153d
3 changed files with 19 additions and 1 deletions

View File

@@ -12,6 +12,7 @@
#include <linux/slab.h>
#include <drm/drm_edid.h>
#include <drm/bridge/dw_hdmi.h>
#include <media/cec.h>
#include <media/cec-notifier.h>
@@ -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;

View File

@@ -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
*/

View File

@@ -8,6 +8,7 @@
#include <drm/drm_property.h>
#include <sound/hdmi-codec.h>
#include <media/cec.h>
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__ */