From: Bard Liao Date: Mon, 7 Jul 2014 08:48:37 +0000 (+0800) Subject: ASoC: RT286: check ID in i2c level X-Git-Tag: v3.17-rc1~101^2~5^2~5^4~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4b21768a95d68fe26a6a9f08ca93a7c59c13fcac;p=karo-tx-linux.git ASoC: RT286: check ID in i2c level Move ID check from asoc level to i2c level. Signed-off-by: Bard Liao Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index 7c5f9d0f0af2..53eb7f37bb73 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -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++) @@ -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);