From: yj Date: Wed, 26 Mar 2014 06:01:39 +0000 (+0800) Subject: codec:mod for compatible X-Git-Tag: firefly_0821_release~5819 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ab7293222ae330b85c0dbefda6ad94f71cefc020;p=firefly-linux-kernel-4.4.55.git codec:mod for compatible --- diff --git a/sound/soc/codecs/rt3261.c b/sound/soc/codecs/rt3261.c index 1f993df97771..ea5f1ceac7dd 100755 --- a/sound/soc/codecs/rt3261.c +++ b/sound/soc/codecs/rt3261.c @@ -49,7 +49,7 @@ enum { static struct snd_soc_codec *rt3261_codec; -#if 1 +#if 0 #define DBG(x...) printk(KERN_DEBUG x) #else #define DBG(x...) @@ -3363,7 +3363,11 @@ static int rt3261_probe(struct snd_soc_codec *codec) } #endif - rt3261_reset(codec); + ret=rt3261_reset(codec); + if (ret < 0) + { + return -ENODEV; + } snd_soc_update_bits(codec, RT3261_PWR_ANLG1, RT3261_PWR_VREF1 | RT3261_PWR_MB | RT3261_PWR_BG | RT3261_PWR_VREF2, @@ -3576,7 +3580,7 @@ static int rt3261_parse_dt_property(struct device *dev, int ret; enum of_gpio_flags flags; - printk("%s()\n", __FUNCTION__); + DBG("%s()\n", __FUNCTION__); if (!node) return -ENODEV; diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c index 3527e97626de..35e829400efe 100755 --- a/sound/soc/codecs/rt5631.c +++ b/sound/soc/codecs/rt5631.c @@ -120,8 +120,14 @@ static unsigned int rt5631_read_index(struct snd_soc_codec *codec, unsigned int reg) { unsigned int value; + int ret = 0; + + ret = rt5631_write(codec, RT5631_INDEX_ADD, reg); + if (ret < 0) + { + return ret; + } - rt5631_write(codec, RT5631_INDEX_ADD, reg); value = rt5631_read(codec, RT5631_INDEX_DATA); return value; @@ -1985,7 +1991,7 @@ static int rt5631_set_bias_level(struct snd_soc_codec *codec, static int rt5631_probe(struct snd_soc_codec *codec) { struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec); - unsigned int val; + int val; int ret; ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C); if (ret != 0) { @@ -1995,6 +2001,10 @@ static int rt5631_probe(struct snd_soc_codec *codec) codec->cache_bypass = 1; val = rt5631_read_index(codec, RT5631_ADDA_MIXER_INTL_REG3); + if(val < 0) + { + return -ENODEV; + } if (val & 0x0002) rt5631->codec_version = 1; else @@ -2056,7 +2066,6 @@ static int rt5631_remove(struct snd_soc_codec *codec) #if (RT5631_SPK_TIMER == 1) - /* Timer¡¡module¡¡uninstalling */ int ret; ret = del_timer(&spk_timer); if(ret) printk("The timer is still in use...\n");