OSDN Git Service

ASoC: tlv320aic31xx: Fix jack detection after suspend
authorMark Brown <broonie@kernel.org>
Fri, 23 Jul 2021 18:02:00 +0000 (19:02 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 26 Jul 2021 11:42:19 +0000 (12:42 +0100)
commit2c39ca6885a2ec03e5c9e7c12a4da2aa8926605a
tree0afeed56602d011c2684aef4d90268927053a8d1
parent5434d0dc56bce4510109a431a7eb71ec5131ef0f
ASoC: tlv320aic31xx: Fix jack detection after suspend

The tlv320aic31xx driver relies on regcache_sync() to restore the register
contents after going to _BIAS_OFF, for example during system suspend. This
does not work for the jack detection configuration since that is configured
via the same register that status is read back from so the register is
volatile and not cached. This can also cause issues during init if the jack
detection ends up getting set up before the CODEC is initially brought out
of _BIAS_OFF, we will reset the CODEC and resync the cache as part of that
process.

Fix this by explicitly reapplying the jack detection configuration after
resyncing the register cache during power on.

This issue was found by an engineer working off-list on a product
kernel, I just wrote up the upstream fix.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210723180200.25105-1-broonie@kernel.org
Cc: stable@vger.kernel.org
sound/soc/codecs/tlv320aic31xx.c