rk2928phonepad:
author邱建斌 <qjb@rock-chips.com>
Tue, 23 Oct 2012 11:14:38 +0000 (19:14 +0800)
committer邱建斌 <qjb@rock-chips.com>
Tue, 23 Oct 2012 11:14:38 +0000 (19:14 +0800)
fix inside headset unnot boot

drivers/headset_observe/rk_headset.c
sound/soc/codecs/rk2928_codec.c

index 3365da599cfa96df38afcd343d5cb24daa83e53e..3ea2cddafd3004f30d269b2927b16355d2bbe033 100755 (executable)
@@ -597,6 +597,6 @@ static int __init rockchip_headsetobserve_init(void)
        platform_driver_register(&rockchip_headsetobserve_driver);
        return 0;
 }
-module_init(rockchip_headsetobserve_init);
+late_initcall(rockchip_headsetobserve_init);
 MODULE_DESCRIPTION("Rockchip Headset Driver");
 MODULE_LICENSE("GPL");
index 419b5732179cdabed0452078d91df55f686cea2f..79c09b6a4e2a7febe0b04f620f3dec44ef9c1aab 100755 (executable)
@@ -149,6 +149,8 @@ void codec_set_spk(bool on)
 void call_set_spk(bool on)
 {
        struct snd_soc_codec *codec = rk2928_data.codec;
+       if(codec == NULL)
+               return; 
        if(on == 0) {
                printk("%s speaker is disabled\n", __FUNCTION__);
        //      rk2928_write(NULL, CODEC_REG_DAC_MUTE, v_MUTE_DAC(1));
@@ -170,7 +172,8 @@ void call_set_spk(bool on)
 void rk2928_codec_set_spk(bool on)
 {
        struct snd_soc_codec *codec = rk2928_data.codec;
-
+       if(codec == NULL)
+               return;
        printk("%s: headset %s %s PA bias_level=%d\n",__FUNCTION__,on?"in":"out",on?"disable":"enable",codec->dapm.bias_level);
        if(on) {
                rk2928_data.headset_status = HP_IN;