From 0c1b16d49873d483ab03ac7998815192f877986f Mon Sep 17 00:00:00 2001 From: yj Date: Tue, 1 Apr 2014 17:55:46 +0800 Subject: [PATCH] codec: mod compile error && useless log --- sound/soc/codecs/rk616_codec.c | 4 ++-- sound/soc/codecs/rt3261.c | 10 +++++----- sound/soc/codecs/rt5616.c | 11 +++++++---- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/sound/soc/codecs/rk616_codec.c b/sound/soc/codecs/rk616_codec.c index bde655b2fad1..7689b24419b9 100755 --- a/sound/soc/codecs/rk616_codec.c +++ b/sound/soc/codecs/rk616_codec.c @@ -986,7 +986,7 @@ int snd_soc_put_step_volsw(struct snd_kcontrol *kcontrol, return err; } -int snd_soc_get_gpio_enum_double(struct snd_kcontrol *kcontrol, +static int snd_soc_get_gpio_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; @@ -1016,7 +1016,7 @@ int snd_soc_get_gpio_enum_double(struct snd_kcontrol *kcontrol, return 0; } -int snd_soc_put_gpio_enum_double(struct snd_kcontrol *kcontrol, +static int snd_soc_put_gpio_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; diff --git a/sound/soc/codecs/rt3261.c b/sound/soc/codecs/rt3261.c index ea5f1ceac7dd..a159ca1adae5 100755 --- a/sound/soc/codecs/rt3261.c +++ b/sound/soc/codecs/rt3261.c @@ -732,7 +732,7 @@ static int rt3261_asrc_get(struct snd_kcontrol *kcontrol, struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct rt3261_priv *rt3261 = snd_soc_codec_get_drvdata(codec); - printk("%s\n", __FUNCTION__); + DBG("%s\n", __FUNCTION__); ucontrol->value.integer.value[0] = rt3261->asrc_en; return 0; @@ -744,14 +744,14 @@ static int rt3261_asrc_put(struct snd_kcontrol *kcontrol, struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct rt3261_priv *rt3261 = snd_soc_codec_get_drvdata(codec); - printk("%s\n", __FUNCTION__); + DBG("%s\n", __FUNCTION__); if (rt3261->asrc_en == ucontrol->value.integer.value[0]) return 0; rt3261->asrc_en = ucontrol->value.integer.value[0]; switch (rt3261->asrc_en) { case RT3261_ASRC_DIS://disable ASRC - printk("%s disable\n", __FUNCTION__); + DBG("%s disable\n", __FUNCTION__); snd_soc_write(codec, RT3261_ASRC_1, 0x0); snd_soc_write(codec, RT3261_ASRC_2, 0x0); snd_soc_update_bits(codec, RT3261_GEN_CTRL1, 0x70, 0x0); //bard 8-29 @@ -763,7 +763,7 @@ static int rt3261_asrc_put(struct snd_kcontrol *kcontrol, break; case RT3261_ASRC_EN://enable ASRC - printk("%s enable\n", __FUNCTION__); + DBG("%s enable\n", __FUNCTION__); snd_soc_write(codec, RT3261_ASRC_1, 0x9800); snd_soc_write(codec, RT3261_ASRC_2, 0xF800); snd_soc_update_bits(codec, RT3261_GEN_CTRL1, 0x70, 0x70); //bard 8-29 @@ -852,7 +852,7 @@ static int rt3261_mic2_put(struct snd_kcontrol *kcontrol, void rt3261_hp_amp_power(struct snd_soc_codec *codec, int on) { static int hp_amp_power_count; - printk("rt3261_hp_amp_power on=%d hp_amp_power_count=%d\n",on,hp_amp_power_count); + DBG("rt3261_hp_amp_power on=%d hp_amp_power_count=%d\n",on,hp_amp_power_count); // dump_reg(codec); if(on) { if(hp_amp_power_count <= 0) { diff --git a/sound/soc/codecs/rt5616.c b/sound/soc/codecs/rt5616.c index 60a1224d7692..84e63e886d93 100755 --- a/sound/soc/codecs/rt5616.c +++ b/sound/soc/codecs/rt5616.c @@ -419,7 +419,7 @@ static unsigned int bst_tlv[] = { 8, 8, TLV_DB_SCALE_ITEM(5200, 0, 0), }; -int snd_soc_get_gpio_enum_double(struct snd_kcontrol *kcontrol, +static int snd_soc_get_gpio_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; @@ -441,7 +441,7 @@ int snd_soc_get_gpio_enum_double(struct snd_kcontrol *kcontrol, return 0; } -int snd_soc_put_gpio_enum_double(struct snd_kcontrol *kcontrol, +static int snd_soc_put_gpio_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; @@ -1578,14 +1578,17 @@ static int rt5616_probe(struct snd_soc_codec *codec) { struct rt5616_priv *rt5616 = snd_soc_codec_get_drvdata(codec); int ret; - printk("enter %s\n",__func__); + ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C); if (ret != 0) { dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); return ret; } - rt5616_reset(codec); + ret = rt5616_reset(codec); + if (ret < 0) + return ret; + snd_soc_update_bits(codec, RT5616_PWR_ANLG1, RT5616_PWR_VREF1 | RT5616_PWR_MB | RT5616_PWR_BG | RT5616_PWR_VREF2, -- 2.34.1