From a9aa9474fef1b52d587174c38087edbb64ec1f4c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=AE=8B=E7=A7=80=E6=9D=B0?= Date: Wed, 7 Nov 2012 09:11:31 +0800 Subject: [PATCH] phonepad: modify HDMI suspend and resume crash, mute pad sound when insert HDMI. --- sound/soc/codecs/rt3261.c | 2 ++ sound/soc/rk29/rk29_rt3261.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/sound/soc/codecs/rt3261.c b/sound/soc/codecs/rt3261.c index c06020b0d2fa..51dc347ca019 100755 --- a/sound/soc/codecs/rt3261.c +++ b/sound/soc/codecs/rt3261.c @@ -544,6 +544,7 @@ void codec_set_spk(bool on) if(!codec) return; + mutex_lock(&codec->mutex); if(on){ DBG("snd_soc_dapm_enable_pin\n"); snd_soc_dapm_enable_pin(&codec->dapm, "Headphone Jack"); @@ -554,6 +555,7 @@ void codec_set_spk(bool on) snd_soc_dapm_disable_pin(&codec->dapm, "Ext Spk"); } snd_soc_dapm_sync(&codec->dapm); + mutex_unlock(&codec->mutex); } diff --git a/sound/soc/rk29/rk29_rt3261.c b/sound/soc/rk29/rk29_rt3261.c index c96d7b8c23d2..091c2617443c 100644 --- a/sound/soc/rk29/rk29_rt3261.c +++ b/sound/soc/rk29/rk29_rt3261.c @@ -23,6 +23,7 @@ #include "../codecs/rt3261.h" #include "rk29_pcm.h" #include "rk29_i2s.h" + #if 0 #define DBG(x...) printk(KERN_INFO x) @@ -225,6 +226,19 @@ static int rk29_rt3261_init(struct snd_soc_pcm_runtime *rtd) snd_soc_dapm_enable_pin(dapm, "Headset Jack"); snd_soc_dapm_enable_pin(dapm, "Ext Spk"); snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); +#ifdef CONFIG_HDMI + extern int hdmi_is_insert(void); + extern void codec_set_spk(bool on); + if(hdmi_is_insert()) + codec_set_spk(false); +#endif + +#ifdef CONFIG_HDMI_RK30 + extern int hdmi_get_hotplug(void); + if(hdmi_get_hotplug() == 2/*HDMI_HPD_ACTIVED*/) + codec_set_spk(false); +#endif + snd_soc_dapm_sync(dapm); return 0; -- 2.34.1