ASoC: rt700: wait for the delayed work to finish when the system suspends
Subsystems (3)
PATCH 1/2 ASoC: rt700: wait for the delayed work to finish when the system suspends
From: Shuming Fan <[email protected]>
To avoid the IO error, we need to cancel the delayed work and wait for it to finish.
Signed-off-by Shuming Fan <[email protected]>
--- sound/soc/codecs/rt700-sdw.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/codecs/rt700-sdw.c +3 -0
@@ -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 ;
Signature · 1 line
2.28.0
Quoted 5 lines · On 9/21/20 4:42 AM, [email protected] wrote:
From: Shuming Fan <[email protected]>
To avoid the IO error, we need to cancel the delayed work and wait for it to finish.
Signed-off-by Shuming Fan <[email protected]>
Reviewed-by Pierre-Louis Bossart <[email protected]>
Quoted 19 lines
--- sound/soc/codecs/rt700-sdw.c | 3 +++ 1 file changed, 3 insertions(+)sound/soc/codecs/rt700-sdw.c +3
-0@@ -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 ;