drm: bridge: dw-hdmi: Fix hpd wake up loop calls

For compatibility with gki, dw-hdmi use callback
function instead of direct call dw-hdmi-cec wake up function.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I06fb65eadead5e3395bbd69a4dd465c95c684494
This commit is contained in:
Algea Cao
2022-12-28 10:58:23 +08:00
parent 8a6ca5d2c7
commit 3ed8bec2c8
3 changed files with 30 additions and 3 deletions

View File

@@ -395,7 +395,7 @@ static const struct file_operations dw_hdmi_cec_file_operations = {
.owner = THIS_MODULE,
};
void dw_hdmi_hpd_wake_up(struct platform_device *pdev)
static void dw_hdmi_cec_hpd_wake_up(struct platform_device *pdev)
{
struct dw_hdmi_cec *cec = platform_get_drvdata(pdev);
@@ -415,7 +415,10 @@ void dw_hdmi_hpd_wake_up(struct platform_device *pdev)
input_sync(cec->devinput);
mutex_unlock(&cec->wake_lock);
}
EXPORT_SYMBOL_GPL(dw_hdmi_hpd_wake_up);
static const struct dw_hdmi_cec_wake_ops cec_ops = {
.hpd_wake_up = dw_hdmi_cec_hpd_wake_up,
};
static int dw_hdmi_cec_probe(struct platform_device *pdev)
{
@@ -519,6 +522,8 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev)
ret = misc_register(&cec->misc_dev);
dw_hdmi_cec_wake_ops_register(cec->hdmi, &cec_ops);
return ret;
}

View File

@@ -260,6 +260,7 @@ struct dw_hdmi {
struct hdmi_data_info hdmi_data;
const struct dw_hdmi_plat_data *plat_data;
const struct dw_hdmi_cec_wake_ops *cec_ops;
struct dw_hdcp *hdcp;
int vic;
@@ -3244,7 +3245,11 @@ void dw_hdmi_set_hpd_wake(struct dw_hdmi *hdmi)
if (!hdmi->cec)
return;
dw_hdmi_hpd_wake_up(hdmi->cec);
if (!hdmi->cec_ops)
return;
if (hdmi->cec_ops->hpd_wake_up)
hdmi->cec_ops->hpd_wake_up(hdmi->cec);
}
EXPORT_SYMBOL_GPL(dw_hdmi_set_hpd_wake);
@@ -4476,6 +4481,17 @@ static int get_force_logo_property(struct dw_hdmi *hdmi)
return 0;
}
void
dw_hdmi_cec_wake_ops_register(struct dw_hdmi *hdmi, const struct dw_hdmi_cec_wake_ops *cec_ops)
{
if (!cec_ops || !hdmi)
return;
hdmi->cec_ops = cec_ops;
}
EXPORT_SYMBOL_GPL(dw_hdmi_cec_wake_ops_register);
/* -----------------------------------------------------------------------------
* Probe/remove API, used from platforms based on the DRM bridge API.
*/

View File

@@ -260,6 +260,10 @@ struct dw_hdmi_plat_data {
struct drm_connector *connector;
};
struct dw_hdmi_cec_wake_ops {
void (*hpd_wake_up)(struct platform_device *pdev);
};
struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
const struct dw_hdmi_plat_data *plat_data);
void dw_hdmi_remove(struct dw_hdmi *hdmi);
@@ -332,5 +336,7 @@ void dw_hdmi_qp_set_output_type(struct dw_hdmi_qp *hdmi, u64 val);
bool dw_hdmi_qp_get_output_whether_hdmi(struct dw_hdmi_qp *hdmi);
int dw_hdmi_qp_get_output_type_cap(struct dw_hdmi_qp *hdmi);
void dw_hdmi_set_hpd_wake(struct dw_hdmi *hdmi);
void dw_hdmi_cec_wake_ops_register(struct dw_hdmi *hdmi,
const struct dw_hdmi_cec_wake_ops *cec_ops);
#endif /* __IMX_HDMI_H__ */