rk610 :
author邱建斌 <qjb@rock-chips.com>
Fri, 24 Aug 2012 03:01:58 +0000 (11:01 +0800)
committer邱建斌 <qjb@rock-chips.com>
Fri, 24 Aug 2012 03:01:58 +0000 (11:01 +0800)
[   53.538667] PC is at spk_ctrl_fun+0x10/0x34
[   53.542848] LR is at rk610_codec_i2c_shutdown+0x14/0x30
[   53.548070] pc : [<c07bf278>]    lr : [<c07bf4e8>]    psr: a0000013
[   53.548075] sp : e571be58  ip : 00000000  fp : 6bea8c74
[   53.559543] r10: 00000000  r9 : e571a000  r8 : c04f4d84
[   53.564761] r7 : 00000000  r6 : ee9bea2c  r5 : c0c1e714  r4 : 00000000
[   53.571280] r3 : 00000000  r2 : c0ae3710  r1 : c0ae3710  r0 : 00000000
[   53.577801] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   53.584928] Control: 10c53c7d  Table: 8c4a404a  DAC: 00000015

sound/soc/codecs/rk610_codec.c

index 5820a788e99d44c4b9dbde4525feb91406e43ca3..5c01474d36d57d3fca59963c37c7fb7a0b82fcfc 100755 (executable)
@@ -92,7 +92,7 @@ static const u16 rk610_codec_reg[] = {
        0x0000, 0x00ff, 0x00ff, 0x00ff,  /* 28 */
 };
 
-static struct snd_soc_codec *rk610_codec_codec;
+static struct snd_soc_codec *rk610_codec_codec=NULL;
 /* codec private data */
 struct rk610_codec_priv {
        enum snd_soc_control_type control_type;
@@ -207,8 +207,13 @@ void rk610_codec_reg_read(void)
 
 static void spk_ctrl_fun(int status)
 {
-       struct rk610_codec_priv *rk610_codec =snd_soc_codec_get_drvdata(rk610_codec_codec);
-
+       struct rk610_codec_priv *rk610_codec = NULL;
+       if(rk610_codec_codec == NULL)
+               return;
+       rk610_codec = snd_soc_codec_get_drvdata(rk610_codec_codec);
+       if(rk610_codec == NULL)
+               return;
+               
        if(rk610_codec->spk_ctrl_io)
        {
                DBG("--------%s----------status = %d\n",__FUNCTION__,status);