ASoC: rt5640: fix rt5640_i2c_probe fail sometimes

if the codec is not initialized completely, i2c transfer will be
failed, so we just return PROBE_DEFER to let codec have chance to
be probed later.

Change-Id: I68922ffa7ddf048ebe3f95be9349d38b7b059982
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
Sugar Zhang
2016-03-09 11:50:43 +08:00
committed by Gerrit Code Review
parent 91270fe3f5
commit fb2723796e

View File

@@ -2337,7 +2337,10 @@ static int rt5640_i2c_probe(struct i2c_client *i2c,
msleep(400);
}
regmap_read(rt5640->regmap, RT5640_VENDOR_ID2, &val);
ret = regmap_read(rt5640->regmap, RT5640_VENDOR_ID2, &val);
if (ret)
return -EPROBE_DEFER;
if (val != RT5640_DEVICE_ID) {
dev_err(&i2c->dev,
"Device with ID register %#x is not rt5640/39\n", val);