From: 邱建斌 Date: Tue, 23 Oct 2012 11:14:38 +0000 (+0800) Subject: rk2928phonepad: X-Git-Tag: firefly_0821_release~8331 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d581a088d334084e7582e1f71e8d838e4cd22f71;p=firefly-linux-kernel-4.4.55.git rk2928phonepad: fix inside headset unnot boot --- diff --git a/drivers/headset_observe/rk_headset.c b/drivers/headset_observe/rk_headset.c index 3365da599cfa..3ea2cddafd30 100755 --- a/drivers/headset_observe/rk_headset.c +++ b/drivers/headset_observe/rk_headset.c @@ -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"); diff --git a/sound/soc/codecs/rk2928_codec.c b/sound/soc/codecs/rk2928_codec.c index 419b5732179c..79c09b6a4e2a 100755 --- a/sound/soc/codecs/rk2928_codec.c +++ b/sound/soc/codecs/rk2928_codec.c @@ -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;