diff options
| author | Xinxin Wan <xinxin.wan@intel.com> | 2025-05-30 16:21:19 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-28 16:21:26 +0200 |
| commit | f1aa0fb41b27411d3e67c95a02dc6b4788c2957c (patch) | |
| tree | 4cac3544a3f80710d86b66ab9d3ddce1c5a747c4 /sound | |
| parent | a9310a0fa94f1e4e22b9ec2453d7e0d0e65558bc (diff) | |
| download | linux-f1aa0fb41b27411d3e67c95a02dc6b4788c2957c.tar.gz linux-f1aa0fb41b27411d3e67c95a02dc6b4788c2957c.tar.bz2 linux-f1aa0fb41b27411d3e67c95a02dc6b4788c2957c.zip | |
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 <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Xinxin Wan <xinxin.wan@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250530142120.2944095-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
| -rw-r--r-- | sound/soc/codecs/rt5640.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 3bc63fbcb188..e290a83c20af 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -2811,6 +2811,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); return -ENODEV; |
