summaryrefslogtreecommitdiff
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorOder Chiou <oder_chiou@realtek.com>2022-11-28 15:08:25 +0800
committerMark Brown <broonie@kernel.org>2022-11-28 13:04:36 +0000
commit5fabcc90e79b460d72df582b31854f6018695965 (patch)
tree636355ec2736b63a072349df8e1635f7ff259bc6 /sound/soc/codecs
parent11e87890dab52d14af2b2f3945835ec6db473e3b (diff)
ASoC: rt5640: Fix Jack work after system suspend
We found an corner case in RT5640 codec driver which schedules jack work after system suspend as IRQ was enabled. Due to this, hitting the error as register access happening after suspend as jack worker thread getting scheduled in irq handler. The patch disables the irq during the suspend to prevent the corner case happening. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Reported-by: Mohan Kumar D <mkumard@nvidia.com> Link: https://lore.kernel.org/r/20221128070825.91215-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/rt5640.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index 0f8e6dd214b0..708e55b7431a 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -2792,6 +2792,11 @@ static int rt5640_suspend(struct snd_soc_component *component)
{
struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
+ if (rt5640->irq) {
+ /* disable jack interrupts during system suspend */
+ disable_irq(rt5640->irq);
+ }
+
rt5640_cancel_work(rt5640);
snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
rt5640_reset(component);
@@ -2815,6 +2820,9 @@ static int rt5640_resume(struct snd_soc_component *component)
regcache_cache_only(rt5640->regmap, false);
regcache_sync(rt5640->regmap);
+ if (rt5640->irq)
+ enable_irq(rt5640->irq);
+
if (rt5640->jack) {
if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER) {
snd_soc_component_update_bits(component,