On Mon, Sep 27, 2021 at 04:01:25PM +0000, Ryan Lee wrote:
regcache_cache_only(max98373->regmap, true);
regcache_mark_dirty(max98373->regmap);
We already do the following sequence in max98373_io_init() when the amplifier re-attaches:
if (max98373->first_hw_init) { regcache_cache_bypass(max98373->regmap, false); regcache_mark_dirty(max98373->regmap); }
I don't see what marking the cache as dirty on suspend might do, we will do a sync only in the resume step.
IIRC this is a patch that we've seen before and removed since it wasn't aligned with any other codec driver.
Yes, it does. There was an mute problem report due to amp register reset during suspend/resume. and we confirmed that the modification is effective. (https://partnerissuetracker.corp.google.com/issues/194472331) The added code helps to re-write valid values in cache to the amp hardware when audio resume. Same code was there on i2c driver, but not on Soundwire driver.
More specifically what it does is make the invalidation of the register cache unconditional. It doesn't really matter if the invalidation is done on suspend or resume, so long as it happens before we attempt to resync - this could also be done by deleting the first_hw_init check.