mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
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:
@@ -12,6 +12,7 @@
|
|||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
|
#include <drm/bridge/dw_hdmi.h>
|
||||||
|
|
||||||
#include <media/cec.h>
|
#include <media/cec.h>
|
||||||
#include <media/cec-notifier.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))
|
if (IS_ERR(cec->adap))
|
||||||
return PTR_ERR(cec->adap);
|
return PTR_ERR(cec->adap);
|
||||||
|
|
||||||
|
dw_hdmi_set_cec_adap(cec->hdmi, cec->adap);
|
||||||
|
|
||||||
/* override the module pointer */
|
/* override the module pointer */
|
||||||
cec->adap->owner = THIS_MODULE;
|
cec->adap->owner = THIS_MODULE;
|
||||||
|
|
||||||
|
|||||||
@@ -313,6 +313,7 @@ struct dw_hdmi {
|
|||||||
|
|
||||||
struct mutex cec_notifier_mutex;
|
struct mutex cec_notifier_mutex;
|
||||||
struct cec_notifier *cec_notifier;
|
struct cec_notifier *cec_notifier;
|
||||||
|
struct cec_adapter *cec_adap;
|
||||||
|
|
||||||
hdmi_codec_plugged_cb plugged_cb;
|
hdmi_codec_plugged_cb plugged_cb;
|
||||||
struct device *codec_dev;
|
struct device *codec_dev;
|
||||||
@@ -390,7 +391,13 @@ static void repo_hpd_event(struct work_struct *p_work)
|
|||||||
mutex_unlock(&hdmi->mutex);
|
mutex_unlock(&hdmi->mutex);
|
||||||
|
|
||||||
if (hdmi->bridge.dev) {
|
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);
|
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,
|
.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
|
* IRQ Handling
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <drm/drm_property.h>
|
#include <drm/drm_property.h>
|
||||||
#include <sound/hdmi-codec.h>
|
#include <sound/hdmi-codec.h>
|
||||||
|
#include <media/cec.h>
|
||||||
|
|
||||||
struct drm_display_info;
|
struct drm_display_info;
|
||||||
struct drm_display_mode;
|
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,
|
void dw_hdmi_phy_update_hpd(struct dw_hdmi *hdmi, void *data,
|
||||||
bool force, bool disabled, bool rxsense);
|
bool force, bool disabled, bool rxsense);
|
||||||
void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data);
|
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__ */
|
#endif /* __IMX_HDMI_H__ */
|
||||||
|
|||||||
Reference in New Issue
Block a user