rk30: fix i2s and pcm bug
author邱建斌 <qjb@rock-chips.com>
Sat, 24 Mar 2012 12:51:57 +0000 (20:51 +0800)
committer邱建斌 <qjb@rock-chips.com>
Sat, 24 Mar 2012 12:51:57 +0000 (20:51 +0800)
sound/soc/codecs/rt5631.c
sound/soc/rk29/rk29_pcm.c
sound/soc/rk29/rk29_rt5631.c
sound/soc/rk29/rk30_i2s.c

index b61c35ea5d5ad05820a4f8baf3cc13cde55bb47e..9948c2bb72ba248b252b72261ffa2a7f8bc56f5a 100755 (executable)
@@ -176,7 +176,7 @@ static struct rt5631_init_reg init_list[] = {
        //{RT5631_STEREO_DAC_VOL_1      , 0x004C},
        {RT5631_ADC_REC_MIXER           , 0xb0f0},//Record Mixer source from Mic1 by default
        {RT5631_ADC_CTRL_1              , 0x0006},//STEREO ADC CONTROL 1
-       {RT5631_MIC_CTRL_2              , 0x6600},//0x8800},//0x5500}, //Mic1/Mic2 boost 40DB by default
+       {RT5631_MIC_CTRL_2              , 0x4400},//0x8800},//0x6600}, //Mic1/Mic2 boost 40DB by default
        {RT5631_PWR_MANAG_ADD1          , 0x93e0},
        
 #if RT5631_ALC_ADC_FUNC_ENA    
@@ -1910,8 +1910,13 @@ static int rt5631_set_bias_level(struct snd_soc_codec *codec,
                break;
 
        case SND_SOC_BIAS_STANDBY:
-               rt5631_write_mask(codec, RT5631_PWR_MANAG_ADD2, 0,
-                       PWR_MICBIAS1_VOL | PWR_MICBIAS2_VOL);
+       //      rt5631_write_mask(codec, RT5631_PWR_MANAG_ADD2, 0,
+       //              PWR_MICBIAS1_VOL | PWR_MICBIAS2_VOL);
+               printk("standby rt5631\n");
+               rt5631_write(codec, RT5631_PWR_MANAG_ADD1, 0x0000);
+               rt5631_write(codec, RT5631_PWR_MANAG_ADD2, 0x0000);
+               rt5631_write(codec, RT5631_PWR_MANAG_ADD3, 0x0000);
+               rt5631_write(codec, RT5631_PWR_MANAG_ADD4, 0x0000);             
                break;
 
        case SND_SOC_BIAS_OFF:
@@ -1938,8 +1943,6 @@ static int rt5631_probe(struct snd_soc_codec *codec)
        struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec);
        unsigned int val;
        int ret;
-
-       DBG("%s..............\n", __func__);
        ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C);
        if (ret != 0) {
                dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
index c015652d6a2d052eb41a6fc6163650dc06be2229..8630a4ab5a0baf3e67c8c00c86111864707a4ade 100755 (executable)
@@ -144,8 +144,22 @@ void rk29_audio_buffdone(void *dev_id, int size,
                return;
        if (!substream->runtime)
                return;
+       switch(result)
+       {
+       case RK29_RES_OK:
+               DBG("::%s----%d  RK29_RES_OK\n",__FUNCTION__,__LINE__);
+               break;
+       case RK29_RES_ERR:
+               DBG("::%s----%d  RK29_RES_ERR\n",__FUNCTION__,__LINE__);
+               break;
+       case RK29_RES_ABORT:
+               DBG("Enter::%s----%d RK29_RES_ABORT \n",__FUNCTION__,__LINE__);
+               return;
+       }
 
        prtd = substream->runtime->private_data;
+       if(!(prtd->state & ST_RUNNING))
+               return; 
        DBG("Enter::%s----%d, substream=%p, prtd=%p\n",__FUNCTION__,__LINE__, substream, prtd);
        if (substream){
                snd_pcm_period_elapsed(substream);
index c38fefe198c29da114a4c7c8818d16c7bd92f705..05e5c9af4412c3b9a1aedfe02deef4233efed463 100644 (file)
@@ -195,7 +195,13 @@ static struct snd_soc_dai_link rk29_dai = {
        .stream_name = "RT5631 PCM",
        .codec_name = "RT5631.0-001a",
        .platform_name = "rockchip-audio",
+#if defined(CONFIG_SND_RK29_SOC_I2S_8CH)       
        .cpu_dai_name = "rk29_i2s.0",
+#elif defined(CONFIG_SND_RK29_SOC_I2S_2CH)
+       .cpu_dai_name = "rk29_i2s.1",
+#else
+       .cpu_dai_name = "rk29_i2s.2",
+#endif
        .codec_dai_name = "RT5631 HiFi",
        .init = rk29_rt5631_init,
        .ops = &rk29_ops,
index 0daeeae572301e7cc24498a6bb387f0d7f2727bd..348c3ce54d65dbd757f5c662413c32110dc0e45e 100755 (executable)
@@ -46,7 +46,7 @@
 
 #define pheadi2s  ((pI2S_REG)(i2s->regs))
 
-#define MAX_I2S         2
+#define MAX_I2S         3
 
 struct rk29_i2s_info {
        struct device   *dev;