Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afd6df1f authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

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: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent cbe50b5f
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -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);
		}