From: qjb Date: Thu, 6 Mar 2014 02:57:14 +0000 (+0800) Subject: audio codec : add support compile all audio codec X-Git-Tag: firefly_0821_release~6191 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ef6dfe39325a217556ce8ea4ec0fb86b0e4687e6;p=firefly-linux-kernel-4.4.55.git audio codec : add support compile all audio codec --- diff --git a/drivers/video/rockchip/hdmi/rk_hdmi_task.c b/drivers/video/rockchip/hdmi/rk_hdmi_task.c index 6b4bb599146e..1963fb893ecc 100755 --- a/drivers/video/rockchip/hdmi/rk_hdmi_task.c +++ b/drivers/video/rockchip/hdmi/rk_hdmi_task.c @@ -5,15 +5,21 @@ #ifdef CONFIG_RK_HDMI_CTL_CODEC #ifdef CONFIG_MACH_RK_FAC - #ifdef CONFIG_SND_RK29_SOC_ES8323 + #ifdef CONFIG_SND_RK_SOC_ES8323 extern void es8323_codec_set_spk(bool on); #endif - #ifdef CONFIG_SND_RK29_SOC_RT5616 + #ifdef CONFIG_SND_RK_SOC_RT5616 extern void rt5616_codec_set_spk(bool on); #endif #ifdef CONFIG_SND_RK_SOC_RK616 extern void rk616_codec_set_spk(bool on); #endif + #ifdef CONFIG_SND_RK_SOC_RT5631 + extern void rk610_codec_set_spk(bool on); + #endif + #ifdef CONFIG_SND_RK_SOC_RK610 + extern void rk610_codec_set_spk(bool on); + #endif #else extern void codec_set_spk(bool on); #endif @@ -108,15 +114,21 @@ void hdmi_sys_remove(struct hdmi *hdmi) #endif #ifdef CONFIG_RK_HDMI_CTL_CODEC #ifdef CONFIG_MACH_RK_FAC - #ifdef CONFIG_SND_RK29_SOC_ES8323 + #ifdef CONFIG_SND_RK_SOC_ES8323 es8323_codec_set_spk(1); #endif - #ifdef CONFIG_SND_RK29_SOC_RT5616 + #ifdef CONFIG_SND_RK_SOC_RT5616 rt5616_codec_set_spk(1); #endif #ifdef CONFIG_SND_RK_SOC_RK616 rk616_codec_set_spk(1); - #endif + #endif + #ifdef CONFIG_SND_RK_SOC_RK610 + rk610_codec_set_spk(1); + #endif + #ifdef CONFIG_SND_RK_SOC_RT5631 + rt5631_codec_set_spk(1); + #endif #else codec_set_spk(1); #endif @@ -273,7 +285,13 @@ void hdmi_work(struct work_struct *work) #endif #if defined (CONFIG_SND_RK_SOC_RK616) rk616_codec_set_spk(0); - #endif + #endif + #ifdef CONFIG_SND_RK_SOC_RK610 + rk610_codec_set_spk(1); + #endif + #ifdef CONFIG_SND_RK_SOC_RT5631 + rt5631_codec_set_spk(1); + #endif #else codec_set_spk(0); #endif diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile old mode 100644 new mode 100755 index 1cb2ea0ed49c..f02b0c158f11 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -128,10 +128,11 @@ snd-soc-rt5631-objs := rt5631.o snd-soc-rt5616-objs := rt5616.o snd-soc-rt5631-phone-objs := rt5631_phone.o snd-soc-rt5625-objs := rt5625.o -snd-soc-rt5639-objs := rt5639.o rt5639_ioctl.o rt56xx_ioctl.o -snd-soc-rt5640-objs := rt5640.o rt5640-dsp.o rt5640_ioctl.o rt56xx_ioctl.o -snd-soc-rt3261-objs := rt3261.o rt3261-dsp.o rt3261_ioctl.o rt_codec_ioctl.o +obj-y := rt56xx_ioctl.o +snd-soc-rt5639-objs := rt5639.o rt5639_ioctl.o +snd-soc-rt5640-objs := rt5640.o rt5640-dsp.o rt5640_ioctl.o snd-soc-rt3224-objs := rt3261.o rt3261_ioctl.o rt_codec_ioctl.o +snd-soc-rt3261-objs := rt3261-dsp.o snd-soc-cs42l52-objs := cs42l52.o snd-soc-rk1000-objs := rk1000_codec.o snd-soc-rk610-objs := rk610_codec.o diff --git a/sound/soc/codecs/rk610_codec.c b/sound/soc/codecs/rk610_codec.c index c92a9030633a..5b9ba870aa5e 100755 --- a/sound/soc/codecs/rk610_codec.c +++ b/sound/soc/codecs/rk610_codec.c @@ -135,7 +135,7 @@ static void spk_ctrl_fun(int status) } } -void codec_set_spk(bool on) +void rk610_codec_set_spk(bool on) { struct rk610_codec_priv *rk610_codec; if(!rk610_codec_codec) @@ -151,7 +151,7 @@ void codec_set_spk(bool on) else gpio_set_value(rk610_codec->spk_ctrl_io, GPIO_LOW); } -EXPORT_SYMBOL(codec_set_spk); +EXPORT_SYMBOL(rk610_codec_set_spk); /* * read rk610 register cache diff --git a/sound/soc/codecs/rt3261.c b/sound/soc/codecs/rt3261.c index fa8566d497b3..d01b43a0ae6f 100755 --- a/sound/soc/codecs/rt3261.c +++ b/sound/soc/codecs/rt3261.c @@ -3371,7 +3371,7 @@ static int rt3261_probe(struct snd_soc_codec *codec) } codec->write = rt3261_write; - #if defined (CONFIG_SND_SOC_RT5623) + #if 0//defined (CONFIG_SND_SOC_RT5623) struct clk *iis_clk; //for rt5623 MCLK use iis_clk = clk_get_sys("rk_i2s.2", "i2s"); diff --git a/sound/soc/codecs/rt3261_ioctl.c b/sound/soc/codecs/rt3261_ioctl.c old mode 100644 new mode 100755 index 7408647c9c32..e2865dcad602 --- a/sound/soc/codecs/rt3261_ioctl.c +++ b/sound/soc/codecs/rt3261_ioctl.c @@ -18,7 +18,7 @@ #include "rt3261-dsp.h" #endif -hweq_t hweq_param[] = { +static hweq_t hweq_param[] = { {/* NORMAL */ {0}, {0}, @@ -68,7 +68,7 @@ int rt3261_update_eqmode( return 0; } -void set_drc_agc_enable(struct snd_soc_codec *codec, int enable, int path) +static void set_drc_agc_enable(struct snd_soc_codec *codec, int enable, int path) { snd_soc_update_bits(codec, RT3261_DRC_AGC_1, RT3261_DRC_AGC_P_MASK | RT3261_DRC_AGC_MASK | RT3261_DRC_AGC_UPD, @@ -76,7 +76,7 @@ void set_drc_agc_enable(struct snd_soc_codec *codec, int enable, int path) 1 << RT3261_DRC_AGC_UPD_BIT); } -void set_drc_agc_parameters(struct snd_soc_codec *codec, int attack_rate, +static void set_drc_agc_parameters(struct snd_soc_codec *codec, int attack_rate, int sample_rate, int recovery_rate, int limit_level) { snd_soc_update_bits(codec, RT3261_DRC_AGC_3, RT3261_DRC_AGC_TAR_MASK, @@ -89,7 +89,7 @@ void set_drc_agc_parameters(struct snd_soc_codec *codec, int attack_rate, 0x1 << RT3261_DRC_AGC_UPD_BIT); } -void set_digital_boost_gain(struct snd_soc_codec *codec, +static void set_digital_boost_gain(struct snd_soc_codec *codec, int post_gain, int pre_gain) { snd_soc_update_bits(codec, RT3261_DRC_AGC_2, @@ -100,7 +100,7 @@ void set_digital_boost_gain(struct snd_soc_codec *codec, RT3261_DRC_AGC_UPD, 1 << RT3261_DRC_AGC_UPD_BIT); } -void set_noise_gate(struct snd_soc_codec *codec, int noise_gate_en, +static void set_noise_gate(struct snd_soc_codec *codec, int noise_gate_en, int noise_gate_hold_en, int compression_gain, int noise_gate_th) { snd_soc_update_bits(codec, RT3261_DRC_AGC_3, @@ -114,7 +114,7 @@ void set_noise_gate(struct snd_soc_codec *codec, int noise_gate_en, RT3261_DRC_AGC_UPD, 1 << RT3261_DRC_AGC_UPD_BIT); } -void set_drc_agc_compression(struct snd_soc_codec *codec, +static void set_drc_agc_compression(struct snd_soc_codec *codec, int compression_en, int compression_ratio) { snd_soc_update_bits(codec, RT3261_DRC_AGC_2, @@ -125,7 +125,7 @@ void set_drc_agc_compression(struct snd_soc_codec *codec, RT3261_DRC_AGC_UPD, 1 << RT3261_DRC_AGC_UPD_BIT); } -void get_drc_agc_enable(struct snd_soc_codec *codec, int *enable, int *path) +static void get_drc_agc_enable(struct snd_soc_codec *codec, int *enable, int *path) { unsigned int reg = snd_soc_read(codec, RT3261_DRC_AGC_1); @@ -147,7 +147,7 @@ void get_drc_agc_parameters(struct snd_soc_codec *codec, int *attack_rate, RT3261_DRC_AGC_RC_SFT; } -void get_digital_boost_gain(struct snd_soc_codec *codec, +static void get_digital_boost_gain(struct snd_soc_codec *codec, int *post_gain, int *pre_gain) { unsigned int reg = snd_soc_read(codec, RT3261_DRC_AGC_2); @@ -156,7 +156,7 @@ void get_digital_boost_gain(struct snd_soc_codec *codec, *pre_gain = (reg & RT3261_DRC_AGC_PRB_MASK) >> RT3261_DRC_AGC_PRB_SFT; } -void get_noise_gate(struct snd_soc_codec *codec, int *noise_gate_en, +static void get_noise_gate(struct snd_soc_codec *codec, int *noise_gate_en, int *noise_gate_hold_en, int *compression_gain, int *noise_gate_th) { unsigned int reg = snd_soc_read(codec, RT3261_DRC_AGC_3); @@ -172,7 +172,7 @@ void get_noise_gate(struct snd_soc_codec *codec, int *noise_gate_en, RT3261_DRC_AGC_NGT_SFT; } -void get_drc_agc_compression(struct snd_soc_codec *codec, +static void get_drc_agc_compression(struct snd_soc_codec *codec, int *compression_en, int *compression_ratio) { unsigned int reg = snd_soc_read(codec, RT3261_DRC_AGC_2); diff --git a/sound/soc/codecs/rt5623.c b/sound/soc/codecs/rt5623.c old mode 100644 new mode 100755 index 9ea32e120a70..899a2be7b225 --- a/sound/soc/codecs/rt5623.c +++ b/sound/soc/codecs/rt5623.c @@ -27,13 +27,6 @@ #include "rt5623.h" -#define RT5623_PROC -#ifdef RT5623_PROC -#include -#include -#include -#endif - #define MODEM_ON 1 #define MODEM_OFF 0 @@ -162,17 +155,12 @@ static const struct i2c_device_id rt5623_i2c_id[] = { }; MODULE_DEVICE_TABLE(i2c, rt5623_i2c_id); -static int rt5623_proc_init(void); static int rt5623_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { pr_info("%s(%d)\n", __func__, __LINE__); - #ifdef RT5623_PROC - rt5623_proc_init(); - #endif - i2c_client = i2c; rt5623_reset(i2c); status = MODEM_ON; @@ -180,7 +168,7 @@ static int rt5623_i2c_probe(struct i2c_client *i2c, return 0; } -static int __devexit rt5623_i2c_remove(struct i2c_client *i2c) +static int rt5623_i2c_remove(struct i2c_client *i2c) { return 0; } @@ -191,7 +179,7 @@ struct i2c_driver rt5623_i2c_driver = { .owner = THIS_MODULE, }, .probe = rt5623_i2c_probe, - .remove = __devexit_p(rt5623_i2c_remove), + .remove = rt5623_i2c_remove, .id_table = rt5623_i2c_id, }; @@ -212,113 +200,6 @@ MODULE_AUTHOR("Johnny Hsu "); MODULE_LICENSE("GPL"); -#ifdef RT5623_PROC - -static ssize_t rt5623_proc_write(struct file *file, const char __user *buffer, - unsigned long len, void *data) -{ - char *cookie_pot; - char *p; - int reg; - int value; - - cookie_pot = (char *)vmalloc( len ); - if (!cookie_pot) - { - return -ENOMEM; - } - else - { - if (copy_from_user( cookie_pot, buffer, len )) - return -EFAULT; - } - - switch(cookie_pot[0]) - { - case 'r': - case 'R': - printk("Read reg debug\n"); - if(cookie_pot[1] ==':') - { - strsep(&cookie_pot,":"); - while((p=strsep(&cookie_pot,","))) - { - reg = simple_strtol(p,NULL,16); - value = codec_read(i2c_client,reg); - printk("codec_read:0x%04x = 0x%04x\n",reg,value); - } - printk("\n"); - } - else - { - printk("Error Read reg debug.\n"); - printk("For example: echo r:22,23,24,25>rt5623_ts\n"); - } - break; - case 'w': - case 'W': - printk("Write reg debug\n"); - if(cookie_pot[1] ==':') - { - strsep(&cookie_pot,":"); - while((p=strsep(&cookie_pot,"="))) - { - reg = simple_strtol(p,NULL,16); - p=strsep(&cookie_pot,","); - value = simple_strtol(p,NULL,16); - codec_write(i2c_client,reg,value); - printk("codec_write:0x%04x = 0x%04x\n",reg,value); - } - printk("\n"); - } - else - { - printk("Error Write reg debug.\n"); - printk("For example: w:22=0,23=0,24=0,25=0>rt5623_ts\n"); - } - break; - case 'a': - printk("Dump reg \n"); - - for(reg = 0; reg < 0x6e; reg+=2) - { - value = codec_read(i2c_client,reg); - printk("codec_read:0x%04x = 0x%04x\n",reg,value); - } - - break; - default: - printk("Help for rt5623_ts .\n-->The Cmd list: \n"); - printk("-->'d&&D' Open or Off the debug\n"); - printk("-->'r&&R' Read reg debug,Example: echo 'r:22,23,24,25'>rt5623_ts\n"); - printk("-->'w&&W' Write reg debug,Example: echo 'w:22=0,23=0,24=0,25=0'>rt5623_ts\n"); - break; - } - - return len; -} - -static const struct file_operations rt5623_proc_fops = { - .owner = THIS_MODULE, -}; - -static int rt5623_proc_init(void) -{ - struct proc_dir_entry *rt5623_proc_entry; - rt5623_proc_entry = create_proc_entry("driver/rt5623_ts", 0777, NULL); - if(rt5623_proc_entry != NULL) - { - rt5623_proc_entry->write_proc = rt5623_proc_write; - return 0; - } - else - { - printk("create proc error !\n"); - return -1; - } -} -#endif - diff --git a/sound/soc/codecs/rt5631_phone.c b/sound/soc/codecs/rt5631_phone.c index 53a8ab856d13..c9f1906a46fc 100755 --- a/sound/soc/codecs/rt5631_phone.c +++ b/sound/soc/codecs/rt5631_phone.c @@ -121,7 +121,7 @@ static const u16 rt5631_reg[RT5631_VENDOR_ID2 + 1] = { [RT5631_PSEUDO_SPATL_CTRL] = 0x0553, }; -void rt5631_codec_set_spk(bool on) +void rt5631_phone_set_spk(bool on) { struct snd_soc_codec *codec = rt5631_codec; @@ -1736,7 +1736,7 @@ static const struct pll_div codec_slave_pll_div[] = { {3072000, 12288000, 0x0a90}, }; -struct coeff_clk_div coeff_div[] = { +static struct coeff_clk_div coeff_div[] = { /* sysclk is 256fs */ {2048000, 8000 * 32, 8000, 0x1000}, {2048000, 8000 * 64, 8000, 0x0000}, @@ -2269,14 +2269,14 @@ static int rt5631_resume(struct snd_soc_codec *codec) SNDRV_PCM_FMTBIT_S24_LE | \ SNDRV_PCM_FMTBIT_S8) -struct snd_soc_dai_ops rt5631_ops = { +static struct snd_soc_dai_ops rt5631_ops = { .hw_params = rt5631_hifi_pcm_params, .set_fmt = rt5631_hifi_codec_set_dai_fmt, .set_sysclk = rt5631_hifi_codec_set_dai_sysclk, .set_pll = rt5631_codec_set_dai_pll, }; -struct snd_soc_dai_driver rt5631_dai[] = { +static struct snd_soc_dai_driver rt5631_dai[] = { { .name = "RT5631 HiFi", .id = RT5631_AIF1, @@ -2347,12 +2347,23 @@ static int rt5631_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct rt5631_priv *rt5631; + struct device_node *rt5631_np = i2c->dev.of_node; int ret; + int val = 0; rt5631 = kzalloc(sizeof(struct rt5631_priv), GFP_KERNEL); if (NULL == rt5631) return -ENOMEM; - + if(!of_property_read_u32(rt5631_np, "rt5631-phone", &val)){ + if(val) + { + printk("rt5631 use for phone\n"); + } + else + return -1; + } + else + return -1; i2c_set_clientdata(i2c, rt5631); ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5631, @@ -2381,7 +2392,7 @@ static void rt5631_i2c_shutdown(struct i2c_client *client) // return 0; } -struct i2c_driver rt5631_i2c_driver = { +static struct i2c_driver rt5631_i2c_driver = { .driver = { .name = "RT5631", .owner = THIS_MODULE, diff --git a/sound/soc/codecs/rt5639.c b/sound/soc/codecs/rt5639.c index cf17e7fcbc6c..b06804f4a6ad 100755 --- a/sound/soc/codecs/rt5639.c +++ b/sound/soc/codecs/rt5639.c @@ -443,7 +443,7 @@ static int rt5639_readable_register( } } -void DC_Calibrate(struct snd_soc_codec *codec) +static void DC_Calibrate(struct snd_soc_codec *codec) { unsigned int sclk_src; diff --git a/sound/soc/codecs/rt5639_ioctl.c b/sound/soc/codecs/rt5639_ioctl.c index 7726cac1c575..3719954e689b 100755 --- a/sound/soc/codecs/rt5639_ioctl.c +++ b/sound/soc/codecs/rt5639_ioctl.c @@ -18,7 +18,7 @@ #include "rt5639-dsp.h" #endif -hweq_t hweq_param[] = { +static hweq_t hweq_param[] = { {/* NORMAL */ {0}, {0}, @@ -69,7 +69,7 @@ int rt5639_update_eqmode( return 0; } -void set_drc_agc_enable(struct snd_soc_codec *codec, int enable, int path) +static void set_drc_agc_enable(struct snd_soc_codec *codec, int enable, int path) { snd_soc_update_bits(codec, RT5639_DRC_AGC_1, RT5639_DRC_AGC_P_MASK | RT5639_DRC_AGC_MASK | RT5639_DRC_AGC_UPD, @@ -77,7 +77,7 @@ void set_drc_agc_enable(struct snd_soc_codec *codec, int enable, int path) 1 << RT5639_DRC_AGC_UPD_BIT); } -void set_drc_agc_parameters(struct snd_soc_codec *codec, int attack_rate, +static void set_drc_agc_parameters(struct snd_soc_codec *codec, int attack_rate, int sample_rate, int recovery_rate, int limit_level) { snd_soc_update_bits(codec, RT5639_DRC_AGC_3, RT5639_DRC_AGC_TAR_MASK, @@ -90,7 +90,7 @@ void set_drc_agc_parameters(struct snd_soc_codec *codec, int attack_rate, 0x1 << RT5639_DRC_AGC_UPD_BIT); } -void set_digital_boost_gain(struct snd_soc_codec *codec, +static void set_digital_boost_gain(struct snd_soc_codec *codec, int post_gain, int pre_gain) { snd_soc_update_bits(codec, RT5639_DRC_AGC_2, @@ -101,7 +101,7 @@ void set_digital_boost_gain(struct snd_soc_codec *codec, RT5639_DRC_AGC_UPD, 1 << RT5639_DRC_AGC_UPD_BIT); } -void set_noise_gate(struct snd_soc_codec *codec, int noise_gate_en, +static void set_noise_gate(struct snd_soc_codec *codec, int noise_gate_en, int noise_gate_hold_en, int compression_gain, int noise_gate_th) { snd_soc_update_bits(codec, RT5639_DRC_AGC_3, @@ -115,7 +115,7 @@ void set_noise_gate(struct snd_soc_codec *codec, int noise_gate_en, RT5639_DRC_AGC_UPD, 1 << RT5639_DRC_AGC_UPD_BIT); } -void set_drc_agc_compression(struct snd_soc_codec *codec, +static void set_drc_agc_compression(struct snd_soc_codec *codec, int compression_en, int compression_ratio) { snd_soc_update_bits(codec, RT5639_DRC_AGC_2, @@ -126,7 +126,7 @@ void set_drc_agc_compression(struct snd_soc_codec *codec, RT5639_DRC_AGC_UPD, 1 << RT5639_DRC_AGC_UPD_BIT); } -void get_drc_agc_enable(struct snd_soc_codec *codec, int *enable, int *path) +static void get_drc_agc_enable(struct snd_soc_codec *codec, int *enable, int *path) { unsigned int reg = snd_soc_read(codec, RT5639_DRC_AGC_1); @@ -134,7 +134,7 @@ void get_drc_agc_enable(struct snd_soc_codec *codec, int *enable, int *path) *path = (reg & RT5639_DRC_AGC_P_MASK) >> RT5639_DRC_AGC_P_SFT; } -void get_drc_agc_parameters(struct snd_soc_codec *codec, int *attack_rate, +static void get_drc_agc_parameters(struct snd_soc_codec *codec, int *attack_rate, int *sample_rate, int *recovery_rate, int *limit_level) { unsigned int reg = snd_soc_read(codec, RT5639_DRC_AGC_3); @@ -148,7 +148,7 @@ void get_drc_agc_parameters(struct snd_soc_codec *codec, int *attack_rate, RT5639_DRC_AGC_RC_SFT; } -void get_digital_boost_gain(struct snd_soc_codec *codec, +static void get_digital_boost_gain(struct snd_soc_codec *codec, int *post_gain, int *pre_gain) { unsigned int reg = snd_soc_read(codec, RT5639_DRC_AGC_2); @@ -157,7 +157,7 @@ void get_digital_boost_gain(struct snd_soc_codec *codec, *pre_gain = (reg & RT5639_DRC_AGC_PRB_MASK) >> RT5639_DRC_AGC_PRB_SFT; } -void get_noise_gate(struct snd_soc_codec *codec, int *noise_gate_en, +static void get_noise_gate(struct snd_soc_codec *codec, int *noise_gate_en, int *noise_gate_hold_en, int *compression_gain, int *noise_gate_th) { unsigned int reg = snd_soc_read(codec, RT5639_DRC_AGC_3); @@ -173,7 +173,7 @@ void get_noise_gate(struct snd_soc_codec *codec, int *noise_gate_en, RT5639_DRC_AGC_NGT_SFT; } -void get_drc_agc_compression(struct snd_soc_codec *codec, +static void get_drc_agc_compression(struct snd_soc_codec *codec, int *compression_en, int *compression_ratio) { unsigned int reg = snd_soc_read(codec, RT5639_DRC_AGC_2); diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 929e8c7a865e..f49e1b54f720 100755 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -451,7 +451,7 @@ static int rt5640_readable_register( } } -void DC_Calibrate(struct snd_soc_codec *codec) +static void DC_Calibrate(struct snd_soc_codec *codec) { unsigned int sclk_src; diff --git a/sound/soc/codecs/rt5640_ioctl.c b/sound/soc/codecs/rt5640_ioctl.c index ef51f224ed12..62e7efcf2d06 100755 --- a/sound/soc/codecs/rt5640_ioctl.c +++ b/sound/soc/codecs/rt5640_ioctl.c @@ -18,7 +18,7 @@ #include "rt5640-dsp.h" #endif -hweq_t hweq_param[] = { +static hweq_t hweq_param[] = { {/* NORMAL */ {0}, {0}, @@ -69,7 +69,7 @@ int rt5640_update_eqmode( return 0; } -void set_drc_agc_enable(struct snd_soc_codec *codec, int enable, int path) +static void set_drc_agc_enable(struct snd_soc_codec *codec, int enable, int path) { snd_soc_update_bits(codec, RT5640_DRC_AGC_1, RT5640_DRC_AGC_P_MASK | RT5640_DRC_AGC_MASK | RT5640_DRC_AGC_UPD, @@ -77,7 +77,7 @@ void set_drc_agc_enable(struct snd_soc_codec *codec, int enable, int path) 1 << RT5640_DRC_AGC_UPD_BIT); } -void set_drc_agc_parameters(struct snd_soc_codec *codec, int attack_rate, +static void set_drc_agc_parameters(struct snd_soc_codec *codec, int attack_rate, int sample_rate, int recovery_rate, int limit_level) { snd_soc_update_bits(codec, RT5640_DRC_AGC_3, RT5640_DRC_AGC_TAR_MASK, @@ -90,7 +90,7 @@ void set_drc_agc_parameters(struct snd_soc_codec *codec, int attack_rate, 0x1 << RT5640_DRC_AGC_UPD_BIT); } -void set_digital_boost_gain(struct snd_soc_codec *codec, +static void set_digital_boost_gain(struct snd_soc_codec *codec, int post_gain, int pre_gain) { snd_soc_update_bits(codec, RT5640_DRC_AGC_2, @@ -101,7 +101,7 @@ void set_digital_boost_gain(struct snd_soc_codec *codec, RT5640_DRC_AGC_UPD, 1 << RT5640_DRC_AGC_UPD_BIT); } -void set_noise_gate(struct snd_soc_codec *codec, int noise_gate_en, +static void set_noise_gate(struct snd_soc_codec *codec, int noise_gate_en, int noise_gate_hold_en, int compression_gain, int noise_gate_th) { snd_soc_update_bits(codec, RT5640_DRC_AGC_3, @@ -115,7 +115,7 @@ void set_noise_gate(struct snd_soc_codec *codec, int noise_gate_en, RT5640_DRC_AGC_UPD, 1 << RT5640_DRC_AGC_UPD_BIT); } -void set_drc_agc_compression(struct snd_soc_codec *codec, +static void set_drc_agc_compression(struct snd_soc_codec *codec, int compression_en, int compression_ratio) { snd_soc_update_bits(codec, RT5640_DRC_AGC_2, @@ -126,7 +126,7 @@ void set_drc_agc_compression(struct snd_soc_codec *codec, RT5640_DRC_AGC_UPD, 1 << RT5640_DRC_AGC_UPD_BIT); } -void get_drc_agc_enable(struct snd_soc_codec *codec, int *enable, int *path) +static void get_drc_agc_enable(struct snd_soc_codec *codec, int *enable, int *path) { unsigned int reg = snd_soc_read(codec, RT5640_DRC_AGC_1); @@ -134,7 +134,7 @@ void get_drc_agc_enable(struct snd_soc_codec *codec, int *enable, int *path) *path = (reg & RT5640_DRC_AGC_P_MASK) >> RT5640_DRC_AGC_P_SFT; } -void get_drc_agc_parameters(struct snd_soc_codec *codec, int *attack_rate, +static void get_drc_agc_parameters(struct snd_soc_codec *codec, int *attack_rate, int *sample_rate, int *recovery_rate, int *limit_level) { unsigned int reg = snd_soc_read(codec, RT5640_DRC_AGC_3); @@ -148,7 +148,7 @@ void get_drc_agc_parameters(struct snd_soc_codec *codec, int *attack_rate, RT5640_DRC_AGC_RC_SFT; } -void get_digital_boost_gain(struct snd_soc_codec *codec, +static void get_digital_boost_gain(struct snd_soc_codec *codec, int *post_gain, int *pre_gain) { unsigned int reg = snd_soc_read(codec, RT5640_DRC_AGC_2); @@ -157,7 +157,7 @@ void get_digital_boost_gain(struct snd_soc_codec *codec, *pre_gain = (reg & RT5640_DRC_AGC_PRB_MASK) >> RT5640_DRC_AGC_PRB_SFT; } -void get_noise_gate(struct snd_soc_codec *codec, int *noise_gate_en, +static void get_noise_gate(struct snd_soc_codec *codec, int *noise_gate_en, int *noise_gate_hold_en, int *compression_gain, int *noise_gate_th) { unsigned int reg = snd_soc_read(codec, RT5640_DRC_AGC_3); @@ -173,7 +173,7 @@ void get_noise_gate(struct snd_soc_codec *codec, int *noise_gate_en, RT5640_DRC_AGC_NGT_SFT; } -void get_drc_agc_compression(struct snd_soc_codec *codec, +static void get_drc_agc_compression(struct snd_soc_codec *codec, int *compression_en, int *compression_ratio) { unsigned int reg = snd_soc_read(codec, RT5640_DRC_AGC_2); diff --git a/sound/soc/rockchip/rk_rt5621.c b/sound/soc/rockchip/rk_rt5621.c old mode 100644 new mode 100755 index 17e5fec23a8b..0598567af6b5 --- a/sound/soc/rockchip/rk_rt5621.c +++ b/sound/soc/rockchip/rk_rt5621.c @@ -67,12 +67,12 @@ static int rk29_hw_params(struct snd_pcm_substream *substream, if((24576000%params_rate(params))==0) //for 8k,16k,32k,48k { - snd_soc_dai_set_pll(codec_dai,RT5621_PLL_FR_MCLK,pll_out, 24576000); + snd_soc_dai_set_pll(codec_dai,0,RT5621_PLL_FR_MCLK,pll_out, 24576000); snd_soc_dai_set_sysclk(codec_dai,0, 24576000, SND_SOC_CLOCK_IN); } else if((22579200%params_rate(params))==0) //for 11k,22k,44k { - snd_soc_dai_set_pll(codec_dai,RT5621_PLL_FR_MCLK,pll_out, 22579200); + snd_soc_dai_set_pll(codec_dai,0,RT5621_PLL_FR_MCLK,pll_out, 22579200); snd_soc_dai_set_sysclk(codec_dai,0, 22579200, SND_SOC_CLOCK_IN); } }