From 1079e14d37d6fb9a1e3b052fe7e38d85f8036652 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=82=B1=E5=BB=BA=E6=96=8C?= Date: Thu, 17 Jan 2013 11:38:00 +0800 Subject: [PATCH] ds1006h rk610 codec : fix boot pop noise --- arch/arm/mach-rk30/board-rk3168-ds1006h.c | 1 + arch/arm/plat-rk/include/plat/board.h | 1 + sound/soc/codecs/rk610_codec.c | 32 ++++++++++++++--------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-rk30/board-rk3168-ds1006h.c b/arch/arm/mach-rk30/board-rk3168-ds1006h.c index 5cdd65f95891..355e530e05fd 100755 --- a/arch/arm/mach-rk30/board-rk3168-ds1006h.c +++ b/arch/arm/mach-rk30/board-rk3168-ds1006h.c @@ -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 diff --git a/arch/arm/plat-rk/include/plat/board.h b/arch/arm/plat-rk/include/plat/board.h index a050a320e426..9de7cb23bb30 100755 --- a/arch/arm/plat-rk/include/plat/board.h +++ b/arch/arm/plat-rk/include/plat/board.h @@ -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 diff --git a/sound/soc/codecs/rk610_codec.c b/sound/soc/codecs/rk610_codec.c index 3f6cd71132a0..02c44f288d78 100755 --- a/sound/soc/codecs/rk610_codec.c +++ b/sound/soc/codecs/rk610_codec.c @@ -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 -- 2.34.1