summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAravind Venkateswaran <aravindh@codeaurora.org>2017-07-14 12:16:41 -0700
committerAravind Venkateswaran <aravindh@codeaurora.org>2017-07-14 23:13:24 -0700
commita89db690ae44edadb432740cb7e0817efbbb4d6e (patch)
tree24f80da8fb23c134fbb6fb63284cc9db88e1476c
parentd9fbe4b9210bcf0b7553d224f1c7390c15b91022 (diff)
msm: mdss: dp: do not program audio registers when DP core is off
It is possible that the DP core may already be shutdown when a callback from the audio subsystem is invoked. In such cases, ensure that the callbacks return gracefully without trying to do any hardware programming. CRs-Fixed: 2072592 Change-Id: Ib112c0791852e1c835c739167683f160723b3baa Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_dp.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dp.c b/drivers/video/fbdev/msm/mdss_dp.c
index 2f169074261a..081b0f7263ae 100644
--- a/drivers/video/fbdev/msm/mdss_dp.c
+++ b/drivers/video/fbdev/msm/mdss_dp.c
@@ -1094,8 +1094,14 @@ static int dp_audio_info_setup(struct platform_device *pdev,
struct mdss_dp_drv_pdata *dp_ctrl = platform_get_drvdata(pdev);
if (!dp_ctrl || !params) {
- DEV_ERR("%s: invalid input\n", __func__);
- return -ENODEV;
+ pr_err("invalid input\n");
+ rc = -ENODEV;
+ goto end;
+ }
+
+ if (!dp_ctrl->power_on) {
+ pr_debug("DP is already power off\n");
+ goto end;
}
mdss_dp_audio_setup_sdps(&dp_ctrl->ctrl_io, params->num_of_channels);
@@ -1103,6 +1109,7 @@ static int dp_audio_info_setup(struct platform_device *pdev,
mdss_dp_set_safe_to_exit_level(&dp_ctrl->ctrl_io, dp_ctrl->lane_cnt);
mdss_dp_audio_enable(&dp_ctrl->ctrl_io, true);
+end:
return rc;
} /* dp_audio_info_setup */
@@ -1134,6 +1141,11 @@ static void dp_audio_teardown_done(struct platform_device *pdev)
return;
}
+ if (!dp->power_on) {
+ pr_err("DP is already power off\n");
+ return;
+ }
+
mdss_dp_audio_enable(&dp->ctrl_io, false);
/* Make sure the DP audio engine is disabled */
wmb();