Skip to contentSkip to conversation

ASoC: rt5663: add cancel_delayed_work_sync when system suspends

PATCH RESEND New [email protected] 1 participant 1 message Dec 28, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 ASoC: rt5663: add cancel_delayed_work_sync when system suspends

From: Shuming Fan <[email protected]>

This patch makes sure that the workqueue is completed before the system suspends.

Change-Id Ib8df80dcb4188f4556e9473364f2184a76c81c01
---
 sound/soc/codecs/rt5663.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/codecs/rt5663.c +3 -0
index 77246f84de29..907f537c97ef 100644
@@ -3186,6 +3186,9 @@ static int rt5663_suspend(struct snd_soc_component *component)
 {
 	struct rt5663_priv *rt5663 = snd_soc_component_get_drvdata(component);
 
+	cancel_delayed_work_sync(&rt5663->jack_detect_work);
+	cancel_delayed_work_sync(&rt5663->jd_unplug_work);
+
 	regcache_cache_only(rt5663->regmap, true);
 	regcache_mark_dirty(rt5663->regmap);
 
Signature · 1 line
2.34.1