aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorShuming Fan <shumingf@realtek.com>2020-09-21 17:42:44 +0800
committerMark Brown <broonie@kernel.org>2020-09-21 20:40:51 +0100
commit5f2df2a4583b0d7b85054f0c1820f11a01936d35 (patch)
tree2f9f891f6fddf82c683dd2b6e70e7354ed678a27 /sound
parent244ac15de75ca62ed7a09c7291b67aeead9e12ac (diff)
downloadlinux-media-5f2df2a4583b0d7b85054f0c1820f11a01936d35.tar.gz
ASoC: rt700: wait for the delayed work to finish when the system suspends
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> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200921094244.31869-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/rt700-sdw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt700-sdw.c b/sound/soc/codecs/rt700-sdw.c
index 1d24bf0407182c..af6e17e457b46c 100644
--- a/sound/soc/codecs/rt700-sdw.c
+++ b/sound/soc/codecs/rt700-sdw.c
@@ -490,6 +490,9 @@ static int __maybe_unused rt700_dev_suspend(struct device *dev)
if (!rt700->hw_init)
return 0;
+ cancel_delayed_work_sync(&rt700->jack_detect_work);
+ cancel_delayed_work_sync(&rt700->jack_btn_check_work);
+
regcache_cache_only(rt700->regmap, true);
return 0;