From 08c3b4ccb9ef4c641f7359ceaf2ba9d8e73bf04e Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=99=88=E9=87=91=E6=B3=89?= Date: Fri, 29 Jul 2011 10:05:55 +0800 Subject: [PATCH] Use gpio for codec pop noise --- sound/soc/codecs/wm8900.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index c189b846b04b..dc51742593f0 100755 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c @@ -252,6 +252,9 @@ EXPORT_SYMBOL_GPL(codec_set_spk); static void wm8900_powerdown(void) { printk("Power down wm8900\n"); +#ifndef WM8900_NO_POWEROFF + gpio_set_value(RK29_PIN1_PD6, GPIO_LOW); +#endif snd_soc_write(wm8900_codec, WM8900_REG_POWER1, 0x210D); @@ -293,7 +296,8 @@ static void wm8900_set_hw(struct snd_soc_codec *codec) return; printk("Power up wm8900\n"); - +//CLK , PATH, VOL,POW. + snd_soc_write(codec, WM8900_REG_HPCTL1, 0x30); snd_soc_write(codec, WM8900_REG_POWER1, 0x0100); snd_soc_write(codec, WM8900_REG_POWER3, 0x60); @@ -351,7 +355,10 @@ static void wm8900_set_hw(struct snd_soc_codec *codec) gpio_set_value(SPK_CON, GPIO_HIGH); } #endif - +#ifndef WM8900_NO_POWEROFF + msleep(350); + gpio_set_value(RK29_PIN1_PD6, GPIO_HIGH); +#endif wm8900_current_status |= WM8900_IS_STARTUP; } @@ -1163,6 +1170,10 @@ static int wm8900_probe(struct platform_device *pdev) struct snd_soc_codec *codec; int ret = 0; +#ifndef WM8900_NO_POWEROFF + gpio_set_value(RK29_PIN1_PD6, GPIO_LOW); +#endif + WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__); if (!wm8900_codec) { -- 2.34.1