rk29_phone wm8994: 修正关机时候产生噪音,通话设置音量问题
author邱建斌 <qjb@rock-chips.com>
Wed, 1 Jun 2011 02:54:53 +0000 (10:54 +0800)
committer邱建斌 <qjb@rock-chips.com>
Wed, 1 Jun 2011 02:54:53 +0000 (10:54 +0800)
sound/soc/codecs/wm8994.c
sound/soc/rk29/rk29_pcm.c

index 47543a00ef9257b184252e0e7591e0c695b3c58f..78f942190e9b0caf12678761cf5cad60ad3dfd6c 100755 (executable)
@@ -3043,6 +3043,7 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
        codec->bias_level = level;
        return 0;
 }
+
 #endif
 #define WM8994_RATES SNDRV_PCM_RATE_8000_48000
 #define WM8994_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
@@ -3454,6 +3455,21 @@ static int wm8994_i2c_resume(struct i2c_client *client)
 #define wm8994_i2c_resume NULL
 #endif
 
+static void wm8994_i2c_shutdown(struct i2c_client *client)
+{
+       DBG("%s----%d\n",__FUNCTION__,__LINE__);
+
+       //disable PA
+       PA_ctrl(GPIO_LOW);
+
+       wm8994_write(0x00, 0x00);
+       
+       gpio_request(WM_EN_PIN, NULL);
+       gpio_direction_output(WM_EN_PIN,GPIO_LOW);
+       gpio_free(WM_EN_PIN);   
+       msleep(50);     
+}
+
 static const struct i2c_device_id wm8994_i2c_id[] = {
        { "wm8994", 0 },
        { }
@@ -3470,6 +3486,7 @@ static struct i2c_driver wm8994_i2c_driver = {
        .suspend = wm8994_i2c_suspend,
        .resume = wm8994_i2c_resume,
        .id_table = wm8994_i2c_id,
+       .shutdown = wm8994_i2c_shutdown,
 };
 
 int reg_send_data(struct i2c_client *client, unsigned short *reg, unsigned short *data, u32 scl_rate)
index d9ac85e96ed7fb3db6bb6724eed42d4436f30f36..f04bc5f812d868f256451b17b910bc63ae376358 100755 (executable)
@@ -426,7 +426,7 @@ static int rockchip_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
        struct rockchip_runtime_data *prtd = substream->runtime->private_data;
        int ret = 0;
        /**************add by qiuen for volume*****/
-/*     struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *pCodec_dai = rtd->dai->codec_dai;
        int vol = 0;
        int streamType = 0;
@@ -438,7 +438,7 @@ static int rockchip_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
                streamType = (substream->number / 100) % 100;
                DBG("enter:vol=%d,streamType=%d\n",vol,streamType);
                pCodec_dai->ops->set_volume(streamType, vol);
-       }*/
+       }
        /****************************************************/
        spin_lock(&prtd->lock);