mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
ASoC: codecs: rt5640: Retry DEVICE_ID verification
[ Upstream commit 19f971057b2d7b99c80530ec1052b45de236a8da ] To be more resilient to codec-detection failures when the hardware powers on slowly, add retry mechanism to the device verification check. Similar pattern is found throughout a number of Realtek codecs. Our tests show that 60ms delay is sufficient to address readiness issues on rt5640 chip. Reviewed-by: Amadeusz Sławiński <[email protected]> Reviewed-by: Cezary Rojewski <[email protected]> Signed-off-by: Xinxin Wan <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
a9310a0fa9
commit
f1aa0fb41b
1 changed files with 5 additions and 0 deletions
|
|
@ -2810,6 +2810,11 @@ static int rt5640_i2c_probe(struct i2c_client *i2c,
|
|||
}
|
||||
|
||||
regmap_read(rt5640->regmap, RT5640_VENDOR_ID2, &val);
|
||||
if (val != RT5640_DEVICE_ID) {
|
||||
usleep_range(60000, 100000);
|
||||
regmap_read(rt5640->regmap, RT5640_VENDOR_ID2, &val);
|
||||
}
|
||||
|
||||
if (val != RT5640_DEVICE_ID) {
|
||||
dev_err(&i2c->dev,
|
||||
"Device with ID register %#x is not rt5640/39\n", val);
|
||||
|
|
|
|||
Loading…
Reference in a new issue