diff mbox series

[2/2] ASoC: rt711: wait for the delayed work to finish when the system suspends

Message ID 20200921094308.31921-1-shumingf@realtek.com
State Accepted
Commit 501ef013390b774e8e61000a78d1d640d6c3411d
Headers show
Series [1/2] ASoC: rt700: wait for the delayed work to finish when the system suspends | expand

Commit Message

Shuming [θŒƒζ›ΈιŠ˜] Sept. 21, 2020, 9:43 a.m. UTC
From: Shuming Fan <shumingf@realtek.com>

To avoid the IO error, we need to cancel the delayed work and wait for it to finish.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
---
 sound/soc/codecs/rt711-sdw.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/codecs/rt711-sdw.c b/sound/soc/codecs/rt711-sdw.c
index 28d663673320..3a8ca600d1cf 100644
--- a/sound/soc/codecs/rt711-sdw.c
+++ b/sound/soc/codecs/rt711-sdw.c
@@ -491,6 +491,10 @@  static int __maybe_unused rt711_dev_suspend(struct device *dev)
 	if (!rt711->hw_init)
 		return 0;
 
+	cancel_delayed_work_sync(&rt711->jack_detect_work);
+	cancel_delayed_work_sync(&rt711->jack_btn_check_work);
+	cancel_work_sync(&rt711->calibration_work);
+
 	regcache_cache_only(rt711->regmap, true);
 
 	return 0;