aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBard Liao <bardliao@realtek.com>2014-07-07 04:48:37 -0400
committerMark Brown <broonie@linaro.org>2014-07-07 06:26:40 -0400
commit4b21768a95d68fe26a6a9f08ca93a7c59c13fcac (patch)
tree73b428a7ef83847664130cff142ab5239649a632
parent305b8d8782c3b4aa572d496769b93cc3db2ae892 (diff)
ASoC: RT286: check ID in i2c level
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>
-rw-r--r--sound/soc/codecs/rt286.c16
1 files changed, 8 insertions, 8 deletions
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)
952 struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec); 952 struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec);
953 int i, ret; 953 int i, ret;
954 954
955 ret = snd_soc_read(codec,
956 RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID));
957 if (ret != RT286_VENDOR_ID) {
958 dev_err(codec->dev,
959 "Device with ID register %x is not rt286\n", ret);
960 return -ENODEV;
961 }
962
963 snd_soc_write(codec, RT286_SET_AUDIO_POWER, AC_PWRST_D3); 955 snd_soc_write(codec, RT286_SET_AUDIO_POWER, AC_PWRST_D3);
964 956
965 for (i = 0; i < RT286_POWER_REG_LEN; i++) 957 for (i = 0; i < RT286_POWER_REG_LEN; i++)
@@ -1164,6 +1156,14 @@ static int rt286_i2c_probe(struct i2c_client *i2c,
1164 return ret; 1156 return ret;
1165 } 1157 }
1166 1158
1159 regmap_read(rt286->regmap,
1160 RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &ret);
1161 if (ret != RT286_VENDOR_ID) {
1162 dev_err(&i2c->dev,
1163 "Device with ID register %x is not rt286\n", ret);
1164 return -ENODEV;
1165 }
1166
1167 rt286->index_cache = rt286_index_def; 1167 rt286->index_cache = rt286_index_def;
1168 rt286->i2c = i2c; 1168 rt286->i2c = i2c;
1169 i2c_set_clientdata(i2c, rt286); 1169 i2c_set_clientdata(i2c, rt286);