Skip to content

Commit aa50406

Browse files
oortcometgregkh
authored andcommitted
ASoC: rt5682: fix the wrong jack type detected
commit 8deb34a upstream. 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, so add a lock. Signed-off-by: Derek Fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/20211214105033.471-1-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 46b3fe1 commit aa50406

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

sound/soc/codecs/rt5682.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,8 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
927927
unsigned int val, count;
928928

929929
if (jack_insert) {
930+
snd_soc_dapm_mutex_lock(dapm);
931+
930932
snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
931933
RT5682_PWR_VREF2 | RT5682_PWR_MB,
932934
RT5682_PWR_VREF2 | RT5682_PWR_MB);
@@ -973,6 +975,8 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
973975
snd_soc_component_update_bits(component, RT5682_MICBIAS_2,
974976
RT5682_PWR_CLK25M_MASK | RT5682_PWR_CLK1M_MASK,
975977
RT5682_PWR_CLK25M_PU | RT5682_PWR_CLK1M_PU);
978+
979+
snd_soc_dapm_mutex_unlock(dapm);
976980
} else {
977981
rt5682_enable_push_button_irq(component, false);
978982
snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,

0 commit comments

Comments
 (0)