From 067e209a7de1f410014f948b93f20cacdc648f24 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=82=B1=E5=BB=BA=E6=96=8C?= Date: Wed, 1 Jun 2011 10:54:53 +0800 Subject: [PATCH] =?utf8?q?rk29=5Fphone=20wm8994:=20=E4=BF=AE=E6=AD=A3?= =?utf8?q?=E5=85=B3=E6=9C=BA=E6=97=B6=E5=80=99=E4=BA=A7=E7=94=9F=E5=99=AA?= =?utf8?q?=E9=9F=B3=EF=BC=8C=E9=80=9A=E8=AF=9D=E8=AE=BE=E7=BD=AE=E9=9F=B3?= =?utf8?q?=E9=87=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- sound/soc/codecs/wm8994.c | 17 +++++++++++++++++ sound/soc/rk29/rk29_pcm.c | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 47543a00ef92..78f942190e9b 100755 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -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) diff --git a/sound/soc/rk29/rk29_pcm.c b/sound/soc/rk29/rk29_pcm.c index d9ac85e96ed7..f04bc5f812d8 100755 --- a/sound/soc/rk29/rk29_pcm.c +++ b/sound/soc/rk29/rk29_pcm.c @@ -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); -- 2.34.1