Skip to content

Commit bc4be65

Browse files
oder-chioubroonie
authored andcommitted
ASoC: rt5682: cancel jack_detect_work if hs_jack is set to null even soundwire mode
Base on https://patchwork.kernel.org/patch/11237953/ Soundwire mode also should follow it. Signed-off-by: Oder Chiou <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 3f31f7d commit bc4be65

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

sound/soc/codecs/rt5682.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -992,16 +992,17 @@ static int rt5682_set_jack_detect(struct snd_soc_component *component,
992992

993993
rt5682->hs_jack = hs_jack;
994994

995-
if (!rt5682->is_sdw) {
996-
if (!hs_jack) {
997-
regmap_update_bits(rt5682->regmap, RT5682_IRQ_CTRL_2,
998-
RT5682_JD1_EN_MASK, RT5682_JD1_DIS);
999-
regmap_update_bits(rt5682->regmap, RT5682_RC_CLK_CTRL,
1000-
RT5682_POW_JDH | RT5682_POW_JDL, 0);
1001-
cancel_delayed_work_sync(&rt5682->jack_detect_work);
1002-
return 0;
1003-
}
995+
if (!hs_jack) {
996+
regmap_update_bits(rt5682->regmap, RT5682_IRQ_CTRL_2,
997+
RT5682_JD1_EN_MASK, RT5682_JD1_DIS);
998+
regmap_update_bits(rt5682->regmap, RT5682_RC_CLK_CTRL,
999+
RT5682_POW_JDH | RT5682_POW_JDL, 0);
1000+
cancel_delayed_work_sync(&rt5682->jack_detect_work);
10041001

1002+
return 0;
1003+
}
1004+
1005+
if (!rt5682->is_sdw) {
10051006
switch (rt5682->pdata.jd_src) {
10061007
case RT5682_JD1:
10071008
snd_soc_component_update_bits(component,

0 commit comments

Comments
 (0)