On Fri, Jul 23, 2021 at 02:29:51PM +0100, Frederick Gotham wrote:
When the device is powered back on, the previous setting for microphone bias (MICBIAS) is lost. If it was previously set to 2 volts or 2.5 volts, then when it's powered back on it becomes Off.
If this is configured in a volatile register (I don't know off hand) then it needs to be specifically saved and restored separately, I know this is an issue with the accessory detection - I've got a patch from talking to someone else about an issue they were having there.
However I think that the call to "regcache_cache_only" should come before the soft reset takeS place. The setting for MICBIAS is lost at this line:
snd_soc_component_write(component, AIC3X_RESET, SOFT_RESET);
And so I think that the call to "regcache_cache_only" should be moved up above "snd_soc_component_write", as follows:
/* * Do soft reset to this codec instance in order to clear * possible VDD leakage currents in case the supply regulators * remain on */ regcache_cache_only(aic3x->regmap, true); snd_soc_component_write(component, AIC3X_RESET, SOFT_RESET);
I don't understand how you think this will fix things - we're still powering off the regulators (if they're controllable or if that happens over suspend) so we'll still loose all the register state and exactly the same thing will happen when we try to restore, at best this will mean the reset that's being done there doesn't actually happens so we've got the risk of having higher power consumption over suspend if the supplies are maintained over suspend.