ds1006h rk610 codec : fix boot pop noise
author邱建斌 <qjb@rock-chips.com>
Thu, 17 Jan 2013 03:38:00 +0000 (11:38 +0800)
committer邱建斌 <qjb@rock-chips.com>
Thu, 17 Jan 2013 03:38:00 +0000 (11:38 +0800)
arch/arm/mach-rk30/board-rk3168-ds1006h.c
arch/arm/plat-rk/include/plat/board.h
sound/soc/codecs/rk610_codec.c

index 5cdd65f958913983ae704682fa0424d47c7fd3f8..355e530e05fdb5a7b0a013267d854db6c0af9cc9 100755 (executable)
@@ -542,6 +542,7 @@ static int rk610_codec_io_init(void)
 static struct rk610_codec_platform_data rk610_codec_pdata = {
        .spk_ctl_io = RK30_PIN2_PD7,
        .io_init = rk610_codec_io_init,
+       .boot_depop = 1,
 };
 #endif
 
index a050a320e4268ef091069f3c24c24f1945734fe9..9de7cb23bb304d9a45bbe210be9c7c3e46f09678 100755 (executable)
@@ -423,6 +423,7 @@ struct rt3261_platform_data {
 struct rk610_codec_platform_data {
        unsigned int spk_ctl_io;
        int (*io_init)(void);
+       int boot_depop;//if found boot pop,set boot_depop 1 test
 };
 
 #define BOOT_MODE_NORMAL               0
index 3f6cd71132a01521a77887c05bb2dda697f19998..02c44f288d7853a1feef183fe5c0004173e9c20c 100755 (executable)
@@ -63,7 +63,7 @@
 /*
  * Debug
  */
-#if 0
+#if 1
 #define        DBG(x...)       printk(KERN_INFO x)
 #else
 #define        DBG(x...)
@@ -590,13 +590,16 @@ static int rk610_codec_mute(struct snd_soc_dai *dai, int mute)
 static void rk610_delayedwork_fun(struct work_struct *work)
 {
     struct snd_soc_codec *codec = rk610_codec_codec;
+       struct rk610_codec_priv *rk610_codec =snd_soc_codec_get_drvdata(codec); 
+       struct rk610_codec_platform_data *pdata= rk610_codec->pdata;    
        DBG("--------%s----------\n",__FUNCTION__);
-
-       #if OUT_CAPLESS
-       rk610_codec_write(codec,ACCELCODEC_R1F, 0x09|ASC_PDMIXM_ENABLE);
-       #else
-       rk610_codec_write(codec,ACCELCODEC_R1F, 0x09|ASC_PDMIXM_ENABLE|ASC_PDPAM_ENABLE);
-       #endif
+       if(!pdata->boot_depop){
+               #if OUT_CAPLESS
+               rk610_codec_write(codec,ACCELCODEC_R1F, 0x09|ASC_PDMIXM_ENABLE);
+               #else
+               rk610_codec_write(codec,ACCELCODEC_R1F, 0x09|ASC_PDMIXM_ENABLE|ASC_PDPAM_ENABLE);
+               #endif
+       }
        spk_ctrl_fun(GPIO_HIGH);
 }
 
@@ -658,6 +661,8 @@ static int rk610_codec_resume(struct snd_soc_codec *codec)
 void rk610_codec_reg_set(void)
 {
     struct snd_soc_codec *codec = rk610_codec_codec;
+       struct rk610_codec_priv *rk610_codec =snd_soc_codec_get_drvdata(codec); 
+       struct rk610_codec_platform_data *pdata= rk610_codec->pdata;
     unsigned int digital_gain;
        unsigned int mic_vol = Volume_Input;
        rk610_codec_write(codec,ACCELCODEC_R1D, 0x30);
@@ -715,12 +720,13 @@ void rk610_codec_reg_set(void)
     rk610_codec_write(codec,ACCELCODEC_R0B, ASC_DEC_ENABLE|ASC_INT_ENABLE);
     gR0BReg = ASC_DEC_ENABLE|ASC_INT_ENABLE;  //ASC_DEC_DISABLE|ASC_INT_ENABLE;
 
-
-//     #if OUT_CAPLESS
-//     rk610_codec_write(codec,ACCELCODEC_R1F, 0x09|ASC_PDMIXM_ENABLE);
-//     #else
-//     rk610_codec_write(codec,ACCELCODEC_R1F, 0x09|ASC_PDMIXM_ENABLE|ASC_PDPAM_ENABLE);
-//     #endif
+       if(pdata->boot_depop){
+               #if OUT_CAPLESS
+               rk610_codec_write(codec,ACCELCODEC_R1F, 0x09|ASC_PDMIXM_ENABLE);
+               #else
+               rk610_codec_write(codec,ACCELCODEC_R1F, 0x09|ASC_PDMIXM_ENABLE|ASC_PDPAM_ENABLE);
+               #endif
+       }       
 }
 
 #ifdef RK610_PROC