codec:mod for compatible

This commit is contained in:
yj
2014-03-26 14:01:39 +08:00
parent 308e7d362b
commit ab7293222a
2 changed files with 19 additions and 6 deletions

View File

@@ -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;

View File

@@ -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<65><72>module<6C><65>uninstalling */
int ret;
ret = del_timer(&spk_timer);
if(ret) printk("The timer is still in use...\n");