phonepad: modify HDMI suspend and resume crash, mute pad sound when insert HDMI.
author宋秀杰 <sxj@rock-chips.com>
Wed, 7 Nov 2012 01:11:31 +0000 (09:11 +0800)
committer宋秀杰 <sxj@rock-chips.com>
Wed, 7 Nov 2012 01:11:31 +0000 (09:11 +0800)
sound/soc/codecs/rt3261.c
sound/soc/rk29/rk29_rt3261.c

index c06020b0d2faaf4d32008fa5c6ad22cbd4d155a4..51dc347ca01921174053fc8baddbddd12d69e705 100755 (executable)
@@ -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);
 }
 
 
index c96d7b8c23d2ac8ffac225e069a59589f1ab4945..091c2617443c24e6bbb9cd32ffc0a587d6fd5a59 100644 (file)
@@ -23,6 +23,7 @@
 #include "../codecs/rt3261.h"\r
 #include "rk29_pcm.h"\r
 #include "rk29_i2s.h"\r
+
 \r
 #if 0\r
 #define        DBG(x...)       printk(KERN_INFO x)\r
@@ -225,6 +226,19 @@ static int rk29_rt3261_init(struct snd_soc_pcm_runtime *rtd)
        snd_soc_dapm_enable_pin(dapm, "Headset Jack");\r
        snd_soc_dapm_enable_pin(dapm, "Ext Spk");\r
        snd_soc_dapm_enable_pin(dapm, "Headphone Jack");\r
+#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);\r
 \r
        return 0;\r