Skip to content

Commit

Permalink
ASoC: RT286: check ID in i2c level
Browse files Browse the repository at this point in the history
Move ID check from asoc level to i2c level.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Bard Liao authored and Mark Brown committed Jul 7, 2014
1 parent 305b8d8 commit 4b21768
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sound/soc/codecs/rt286.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,14 +952,6 @@ static int rt286_probe(struct snd_soc_codec *codec)
struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec);
int i, ret;

ret = snd_soc_read(codec,
RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID));
if (ret != RT286_VENDOR_ID) {
dev_err(codec->dev,
"Device with ID register %x is not rt286\n", ret);
return -ENODEV;
}

snd_soc_write(codec, RT286_SET_AUDIO_POWER, AC_PWRST_D3);

for (i = 0; i < RT286_POWER_REG_LEN; i++)
Expand Down Expand Up @@ -1164,6 +1156,14 @@ static int rt286_i2c_probe(struct i2c_client *i2c,
return ret;
}

regmap_read(rt286->regmap,
RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &ret);
if (ret != RT286_VENDOR_ID) {
dev_err(&i2c->dev,
"Device with ID register %x is not rt286\n", ret);
return -ENODEV;
}

rt286->index_cache = rt286_index_def;
rt286->i2c = i2c;
i2c_set_clientdata(i2c, rt286);
Expand Down

0 comments on commit 4b21768

Please sign in to comment.