This is a note to let you know that I've just added the patch titled ASoC: tlv320aic31xx: Fix jack detection after suspend to the 5.13-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: asoc-tlv320aic31xx-fix-jack-detection-after-suspend.patch and it can be found in the queue-5.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 2c39ca6885a2ec03e5c9e7c12a4da2aa8926605a Mon Sep 17 00:00:00 2001 From: Mark Brown <broonie@xxxxxxxxxx> Date: Fri, 23 Jul 2021 19:02:00 +0100 Subject: ASoC: tlv320aic31xx: Fix jack detection after suspend From: Mark Brown <broonie@xxxxxxxxxx> commit 2c39ca6885a2ec03e5c9e7c12a4da2aa8926605a upstream. 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@xxxxxxxxxx> Link: https://lore.kernel.org/r/20210723180200.25105-1-broonie@xxxxxxxxxx Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/soc/codecs/tlv320aic31xx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -35,6 +35,9 @@ #include "tlv320aic31xx.h" +static int aic31xx_set_jack(struct snd_soc_component *component, + struct snd_soc_jack *jack, void *data); + static const struct reg_default aic31xx_reg_defaults[] = { { AIC31XX_CLKMUX, 0x00 }, { AIC31XX_PLLPR, 0x11 }, @@ -1256,6 +1259,13 @@ static int aic31xx_power_on(struct snd_s return ret; } + /* + * The jack detection configuration is in the same register + * that is used to report jack detect status so is volatile + * and not covered by the cache sync, restore it separately. + */ + aic31xx_set_jack(component, aic31xx->jack, NULL); + return 0; } Patches currently in stable-queue which might be from broonie@xxxxxxxxxx are queue-5.13/asoc-amd-fix-reference-to-pcm-buffer-address.patch queue-5.13/asoc-kirkwood-fix-reference-to-pcm-buffer-address.patch queue-5.13/asoc-xilinx-fix-reference-to-pcm-buffer-address.patch queue-5.13/asoc-uniphier-fix-reference-to-pcm-buffer-address.patch queue-5.13/asoc-intel-atom-fix-reference-to-pcm-buffer-address.patch queue-5.13/asoc-tlv320aic31xx-fix-jack-detection-after-suspend.patch