From 7142fd38de72c292b086029d0b6bd9ad3ba528ef Mon Sep 17 00:00:00 2001 From: Casey Piper Date: Wed, 10 Jun 2015 10:53:43 -0700 Subject: [PATCH] msm: mdss: hdmi: return cable status only when HDMI is powered When audio driver requests the cable status, return that the cable status is connected only when HDMI is powered. This prevents audio from accessing HDMI registers when HDMI clock is off. Change-Id: Icc5016df731725de25b4ca86e2ac3632ab89d5bf Signed-off-by: Casey Piper --- drivers/video/msm/mdss/mdss_hdmi_tx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/video/msm/mdss/mdss_hdmi_tx.c b/drivers/video/msm/mdss/mdss_hdmi_tx.c index 695ca4150f25..f5e20a1a0069 100644 --- a/drivers/video/msm/mdss/mdss_hdmi_tx.c +++ b/drivers/video/msm/mdss/mdss_hdmi_tx.c @@ -2842,7 +2842,7 @@ static int hdmi_tx_get_cable_status(struct platform_device *pdev, u32 vote) } spin_lock_irqsave(&hdmi_ctrl->hpd_state_lock, flags); - hpd = hdmi_ctrl->hpd_state; + hpd = hdmi_ctrl->hpd_state && hdmi_ctrl->panel_power_on; spin_unlock_irqrestore(&hdmi_ctrl->hpd_state_lock, flags); hdmi_ctrl->vote_hdmi_core_on = false; @@ -3136,10 +3136,6 @@ static int hdmi_tx_power_on(struct mdss_panel_data *panel_data) return rc; } - mutex_lock(&hdmi_ctrl->power_mutex); - hdmi_ctrl->panel_power_on = true; - mutex_unlock(&hdmi_ctrl->power_mutex); - if (hdmi_ctrl->hpd_state) { rc = hdmi_tx_start(hdmi_ctrl); if (rc) { @@ -3149,6 +3145,10 @@ static int hdmi_tx_power_on(struct mdss_panel_data *panel_data) return rc; } } + + mutex_lock(&hdmi_ctrl->power_mutex); + hdmi_ctrl->panel_power_on = true; + mutex_unlock(&hdmi_ctrl->power_mutex); end: dss_reg_dump(io->base, io->len, "HDMI-ON: ", REG_DUMP);