diff mbox series

[RESEND] ASoC: rt5663: add cancel_delayed_work_sync when system suspends

Message ID 20231228061444.4187279-1-shumingf@realtek.com (mailing list archive)
State New, archived
Headers show
Series [RESEND] ASoC: rt5663: add cancel_delayed_work_sync when system suspends | expand

Commit Message

Shuming [θŒƒζ›ΈιŠ˜] Dec. 28, 2023, 6:14 a.m. UTC
From: Shuming Fan <shumingf@realtek.com>

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

Change-Id: Ib8df80dcb4188f4556e9473364f2184a76c81c01
Signed-off-by: Shuming Fan <shumingf@realtek.com>
---
 sound/soc/codecs/rt5663.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c
index 77246f84de29..907f537c97ef 100644
--- a/sound/soc/codecs/rt5663.c
+++ b/sound/soc/codecs/rt5663.c
@@ -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);