From 871bfa3462e976169d5e272bcae8001384503848 Mon Sep 17 00:00:00 2001 From: xuhuicong Date: Thu, 1 Sep 2016 11:52:01 +0800 Subject: [PATCH] video: rockchip: dp: fix sound problam when disconnect to dp Change-Id: I49b96426939f0c9d1c016ca00cc5df1f43cbf848 Signed-off-by: xuhuicong --- drivers/video/rockchip/dp/rockchip_dp_core.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/video/rockchip/dp/rockchip_dp_core.c b/drivers/video/rockchip/dp/rockchip_dp_core.c index 6def0eddaa20..02658f71755d 100644 --- a/drivers/video/rockchip/dp/rockchip_dp_core.c +++ b/drivers/video/rockchip/dp/rockchip_dp_core.c @@ -308,6 +308,9 @@ static int cdn_dp_audio_hw_params(struct device *dev, void *data, .channels = 8, }; + if (!cdn_dp_connector_detect(dp)) + return 0; + switch (HDMI_I2S) { case HDMI_I2S: audio.format = AFMT_I2S; @@ -333,9 +336,11 @@ static void cdn_dp_audio_shutdown(struct device *dev, void *data) struct cdn_dp_device *dp = dp_dev->dp; int ret; - ret = cdn_dp_audio_stop(dp, &dp->audio_info); - if (!ret) - dp->audio_info.format = AFMT_UNUSED; + if (cdn_dp_connector_detect(dp)) { + ret = cdn_dp_audio_stop(dp, &dp->audio_info); + if (!ret) + dp->audio_info.format = AFMT_UNUSED; + } } static int cdn_dp_audio_digital_mute(struct device *dev, void *data, @@ -344,6 +349,8 @@ static int cdn_dp_audio_digital_mute(struct device *dev, void *data, struct dp_dev *dp_dev = dev_get_drvdata(dev); struct cdn_dp_device *dp = dp_dev->dp; + if (!cdn_dp_connector_detect(dp)) + return 0; return cdn_dp_audio_mute(dp, enable); } -- 2.34.1