Skip to content

Commit 1a44687

Browse files
yongzhi1broonie
authored andcommitted
ASoC: max98373: reorder max98373_reset() in resume
During S3 test, the following error was observed: [ 726.174237] i2c_designware i2c_designware.0: platform_pm_resume+0x0/0x3d returned 0 after 0 usecs [ 726.184187] max98373 i2c-MX98373:00: calling max98373_resume+0x0/0x30 [snd_soc_max98373] @ 12698, parent: i2c-11 [ 726.195589] max98373 i2c-MX98373:00: Reset command failed. (ret:-16) When calling regmap_update_bits(), since map->reg_update_bits is NULL, _regmap_read() is entered with the following logic: if (!map->cache_bypass) { ret = regcache_read(map, reg, val); if (ret == 0) return 0; } if (map->cache_only) return -EBUSY; regcache_read() hits -EINVAL because MAX98373_R2000_SW_RESET is volatile, as map->cache_only is set by codec suspend, thus -EBUSY is returned. Fix by moving max98373_reset() after cache_only set to false in max98373_resume(). Signed-off-by: Yong Zhi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent afcbaa2 commit 1a44687

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/codecs/max98373.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,8 @@ static int max98373_resume(struct device *dev)
850850
{
851851
struct max98373_priv *max98373 = dev_get_drvdata(dev);
852852

853-
max98373_reset(max98373, dev);
854853
regcache_cache_only(max98373->regmap, false);
854+
max98373_reset(max98373, dev);
855855
regcache_sync(max98373->regmap);
856856
return 0;
857857
}

0 commit comments

Comments
 (0)