summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorAjay Singh Parmar <aparmar@codeaurora.org>2015-03-23 01:27:49 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:45:35 -0700
commit9f50eda8371a05f556b44750d0dd5f1c37cc8dc7 (patch)
tree17229a6cff77ab4c97f5ef032aa0e0791f685cf0 /drivers/video
parent232dc79d1f0fcbc51486709678f3ade920d7cff0 (diff)
msm: mdss: hdmi: Handle fast HPD interrupts
When downstream device cable is connected and disconnected very quickly, or connect/disconnect processing takes more time than expected, HPD state machine needs to be put into right state to make sure HDMI is subsequently turned ON and OFF properly. Change-Id: I96fbc454951b6bbf5af05b2b74a04f7ba4ddce11 Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_tx.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
index cce8ccdb2091..c485c47664c7 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c
+++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
@@ -3430,9 +3430,14 @@ static int hdmi_tx_power_off(struct mdss_panel_data *panel_data)
hdmi_ctrl->panel_power_on = false;
mutex_unlock(&hdmi_ctrl->power_mutex);
+ mutex_lock(&hdmi_ctrl->mutex);
if (hdmi_ctrl->hpd_off_pending) {
- hdmi_tx_hpd_off(hdmi_ctrl);
hdmi_ctrl->hpd_off_pending = false;
+ mutex_unlock(&hdmi_ctrl->mutex);
+ if (!hdmi_ctrl->hpd_state)
+ hdmi_tx_hpd_off(hdmi_ctrl);
+ } else {
+ mutex_unlock(&hdmi_ctrl->mutex);
}
if (hdmi_ctrl->hdmi_tx_hpd_done)
@@ -3661,11 +3666,14 @@ static int hdmi_tx_sysfs_enable_hpd(struct hdmi_tx_ctrl *hdmi_ctrl, int on)
reinit_completion(&hdmi_ctrl->hpd_off_done);
timeout = wait_for_completion_timeout(
&hdmi_ctrl->hpd_off_done, HZ);
-
- if (!timeout)
+ if (!timeout) {
+ hdmi_ctrl->hpd_off_pending = false;
DEV_ERR("%s: hpd off still pending\n",
__func__);
+ return 0;
+ }
}
+
rc = hdmi_tx_hpd_on(hdmi_ctrl);
} else {
mutex_lock(&hdmi_ctrl->power_mutex);
@@ -4118,7 +4126,9 @@ static int hdmi_tx_panel_event_handler(struct mdss_panel_data *panel_data,
hdmi_tx_power_off(panel_data);
panel_data->panel_info.cont_splash_enabled = false;
} else {
- if (hdmi_ctrl->hpd_feature_on)
+ if (hdmi_ctrl->hpd_feature_on &&
+ hdmi_ctrl->hpd_initialized &&
+ !hdmi_ctrl->hpd_state)
hdmi_tx_hpd_polarity_setup(hdmi_ctrl,
HPD_CONNECT_POLARITY);
}