ASoC: rt5682s: Fix the wrong jack type detected
authorDerek Fang <derek.fang@realtek.com>
Wed, 23 Feb 2022 10:14:50 +0000 (18:14 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 24 Feb 2022 02:04:33 +0000 (02:04 +0000)
commitc07ac3ee76e5e5506bca9c03fbbb15e40ab28430
tree57227e9a52a87d9561c3feb74d18115b79e73be2
parent7e1d728a94ca78f8759ba14068932075ecdc562d
ASoC: rt5682s: Fix the wrong jack type detected

Some powers were changed during the jack insert detection and clk's
enable/disable in CCF.
If in parallel, the influence has a chance to detect the wrong jack
type.

We refer to the below commit of the variant codec (rt5682) to fix
this issue.
  ASoC: rt5682: Fix deadlock on resume

1. Remove rt5682s_headset_detect in rt5682s_jd_check_handler and
   use jack_detect_work instead of.
2. Use dapm mutex used in CCF to protect most of jack_detect_work.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20220223101450.4577-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5682s.c
sound/soc/codecs/rt5682s.h